• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llvm-as %s -o %t.o
2
3; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
4; RUN:    --plugin-opt=emit-llvm \
5; RUN:    --plugin-opt=generate-api-file \
6; RUN:    -shared %t.o -o %t2.o
7; RUN: llvm-dis %t2.o -o - | FileCheck %s
8; RUN: FileCheck --check-prefix=API %s < %T/../apifile.txt
9
10; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
11; RUN:     -m elf_x86_64 --plugin-opt=save-temps \
12; RUN:    -shared %t.o -o %t3.o
13; RUN: llvm-dis %t3.o.bc -o - | FileCheck %s
14; RUN: llvm-dis %t3.o.opt.bc -o - | FileCheck --check-prefix=OPT %s
15; RUN: llvm-dis %t3.o.opt.bc -o - | FileCheck --check-prefix=OPT2 %s
16; RUN: llvm-nm %t3.o.o | FileCheck --check-prefix=NM %s
17
18; RUN: rm -f %t4.o
19; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
20; RUN:     -m elf_x86_64 --plugin-opt=disable-output \
21; RUN:    -shared %t.o -o %t4.o
22; RUN: not test -a %t4.o
23
24; NM: T f3
25
26target triple = "x86_64-unknown-linux-gnu"
27
28@g7 = extern_weak global i32
29; CHECK-DAG: @g7 = extern_weak global i32
30
31@g8 = external global i32
32
33; CHECK-DAG: define internal void @f1()
34; OPT2-NOT: @f1
35define hidden void @f1() {
36  ret void
37}
38
39; CHECK-DAG: define hidden void @f2()
40; OPT-DAG: define hidden void @f2()
41define hidden void @f2() {
42  ret void
43}
44
45@llvm.used = appending global [1 x i8*] [ i8* bitcast (void ()* @f2 to i8*)]
46
47; CHECK-DAG: define void @f3()
48; OPT-DAG: define void @f3()
49define void @f3() {
50  call void @f4()
51  ret void
52}
53
54; CHECK-DAG: define internal void @f4()
55; OPT2-NOT: @f4
56define linkonce_odr void @f4() {
57  ret void
58}
59
60; CHECK-DAG: define linkonce_odr void @f5()
61; OPT-DAG: define linkonce_odr void @f5()
62define linkonce_odr void @f5() {
63  ret void
64}
65@g5 = global void()* @f5
66
67; CHECK-DAG: define internal void @f6() unnamed_addr
68; OPT-DAG: define internal void @f6() unnamed_addr
69define linkonce_odr void @f6() unnamed_addr {
70  ret void
71}
72@g6 = global void()* @f6
73
74define i32* @f7() {
75  ret i32* @g7
76}
77
78define i32* @f8() {
79  ret i32* @g8
80}
81
82; API: f1 PREVAILING_DEF_IRONLY
83; API: f2 PREVAILING_DEF_IRONLY
84; API: f3 PREVAILING_DEF_IRONLY_EXP
85; API: f4 PREVAILING_DEF_IRONLY_EXP
86; API: f5 PREVAILING_DEF_IRONLY_EXP
87; API: f6 PREVAILING_DEF_IRONLY_EXP
88; API: f7 PREVAILING_DEF_IRONLY_EXP
89; API: f8 PREVAILING_DEF_IRONLY_EXP
90; API: g7 UNDEF
91; API: g8 UNDEF
92; API: g5 PREVAILING_DEF_IRONLY_EXP
93; API: g6 PREVAILING_DEF_IRONLY_EXP
94