1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[gold] Add case being tested by equivalent lld test

The new tests added by 1487747e990ce9f8851f3d92c3006a74134d7518 for lld
and gold plugin were largely equivalent, but the gold one was missing
one of the cases added to lld. Add that test to the gold plugin version.
This commit is contained in:
Teresa Johnson 2021-02-13 17:09:56 -08:00
parent f4839c7303
commit 0e8ee7dcc3

View File

@ -1,4 +1,4 @@
;; Test that --export-dynamic prevents devirtualization.
;; Test that dynamically exported symbols prevent devirtualization.
;; Note that --export-dynamic-symbol and --dynamic-list are tested similarly
;; in the v1.16 directory, because those were not properly passed down to the
;; plugin until then.
@ -66,6 +66,41 @@
; RUN: --export-dynamic 2>&1 | FileCheck /dev/null --implicit-check-not single-impl --allow-empty
; RUN: llvm-dis %t3.0.4.opt.bc -o - | FileCheck %s --check-prefix=CHECK-NODEVIRT-IR
;; Check that all WPD fails with when linking against a shared library containing
;; preemptible versions of the vtables. In this case the symbols in the object being
;; linked against the shared library must be exported to .dynsym to allow the runtime
;; preemption, even without any options.
;; Index based WPD
; RUN: opt -relocation-model=pic --thinlto-bc -o %t5.o %s
; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \
; RUN: %t5.o -o %t5.so -shared
; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \
; RUN: --plugin-opt=whole-program-visibility \
; RUN: --plugin-opt=-pass-remarks=. \
; RUN: %t5.o %t5.so -o %t5 \
; RUN: --export-dynamic 2>&1 | FileCheck /dev/null --implicit-check-not single-impl --allow-empty
;; Hybrid WPD
; RUN: opt -relocation-model=pic --thinlto-bc --thinlto-split-lto-unit -o %t5.o %s
; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \
; RUN: %t5.o -o %t5.so -shared
; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \
; RUN: --plugin-opt=whole-program-visibility \
; RUN: --plugin-opt=-pass-remarks=. \
; RUN: %t5.o %t5.so -o %t5 \
; RUN: --export-dynamic 2>&1 | FileCheck /dev/null --implicit-check-not single-impl --allow-empty
;; Regular LTO WPD
; RUN: opt -relocation-model=pic -o %t5.o %s
; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \
; RUN: %t5.o -o %t5.so -shared
; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \
; RUN: --plugin-opt=whole-program-visibility \
; RUN: --plugin-opt=-pass-remarks=. \
; RUN: %t5.o %t5.so -o %t5 \
; RUN: --export-dynamic 2>&1 | FileCheck /dev/null --implicit-check-not single-impl --allow-empty
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-grtev4-linux-gnu"