|
1 |
| -;; Test that --export-dynamic prevents devirtualization. |
| 1 | +;; Test that dynamically exported symbols prevent devirtualization. |
2 | 2 | ;; Note that --export-dynamic-symbol and --dynamic-list are tested similarly
|
3 | 3 | ;; in the v1.16 directory, because those were not properly passed down to the
|
4 | 4 | ;; plugin until then.
|
|
66 | 66 | ; RUN: --export-dynamic 2>&1 | FileCheck /dev/null --implicit-check-not single-impl --allow-empty
|
67 | 67 | ; RUN: llvm-dis %t3.0.4.opt.bc -o - | FileCheck %s --check-prefix=CHECK-NODEVIRT-IR
|
68 | 68 |
|
| 69 | +;; Check that all WPD fails with when linking against a shared library containing |
| 70 | +;; preemptible versions of the vtables. In this case the symbols in the object being |
| 71 | +;; linked against the shared library must be exported to .dynsym to allow the runtime |
| 72 | +;; preemption, even without any options. |
| 73 | + |
| 74 | +;; Index based WPD |
| 75 | +; RUN: opt -relocation-model=pic --thinlto-bc -o %t5.o %s |
| 76 | +; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \ |
| 77 | +; RUN: %t5.o -o %t5.so -shared |
| 78 | +; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \ |
| 79 | +; RUN: --plugin-opt=whole-program-visibility \ |
| 80 | +; RUN: --plugin-opt=-pass-remarks=. \ |
| 81 | +; RUN: %t5.o %t5.so -o %t5 \ |
| 82 | +; RUN: --export-dynamic 2>&1 | FileCheck /dev/null --implicit-check-not single-impl --allow-empty |
| 83 | + |
| 84 | +;; Hybrid WPD |
| 85 | +; RUN: opt -relocation-model=pic --thinlto-bc --thinlto-split-lto-unit -o %t5.o %s |
| 86 | +; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \ |
| 87 | +; RUN: %t5.o -o %t5.so -shared |
| 88 | +; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \ |
| 89 | +; RUN: --plugin-opt=whole-program-visibility \ |
| 90 | +; RUN: --plugin-opt=-pass-remarks=. \ |
| 91 | +; RUN: %t5.o %t5.so -o %t5 \ |
| 92 | +; RUN: --export-dynamic 2>&1 | FileCheck /dev/null --implicit-check-not single-impl --allow-empty |
| 93 | + |
| 94 | +;; Regular LTO WPD |
| 95 | +; RUN: opt -relocation-model=pic -o %t5.o %s |
| 96 | +; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \ |
| 97 | +; RUN: %t5.o -o %t5.so -shared |
| 98 | +; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \ |
| 99 | +; RUN: --plugin-opt=whole-program-visibility \ |
| 100 | +; RUN: --plugin-opt=-pass-remarks=. \ |
| 101 | +; RUN: %t5.o %t5.so -o %t5 \ |
| 102 | +; RUN: --export-dynamic 2>&1 | FileCheck /dev/null --implicit-check-not single-impl --allow-empty |
| 103 | + |
69 | 104 | target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
70 | 105 | target triple = "x86_64-grtev4-linux-gnu"
|
71 | 106 |
|
|
0 commit comments