1 ; RUN: llvm-as %s -o %t.o
3 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
4 ; RUN: --plugin-opt=emit-llvm \
5 ; RUN: -shared %t.o -o %t2.o
6 ; RUN: llvm-dis %t2.o -o - | FileCheck %s
8 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
9 ; RUN: -m elf_x86_64 --plugin-opt=save-temps \
10 ; RUN: -shared %t.o -o %t3.o
11 ; RUN: FileCheck --check-prefix=RES %s < %t3.o.resolution.txt
12 ; RUN: llvm-dis %t3.o.0.2.internalize.bc -o - | FileCheck %s
13 ; RUN: llvm-dis %t3.o.0.4.opt.bc -o - | FileCheck --check-prefix=OPT %s
14 ; RUN: llvm-dis %t3.o.0.4.opt.bc -o - | FileCheck --check-prefix=OPT2 %s
15 ; RUN: llvm-nm %t3.o.o | FileCheck --check-prefix=NM %s
18 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
19 ; RUN: -m elf_x86_64 --plugin-opt=disable-output \
20 ; RUN: -shared %t.o -o %t4.o
21 ; RUN: not test -a %t4.o
25 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
26 target triple = "x86_64-unknown-linux-gnu"
28 ; CHECK-DAG: @g1 = weak_odr constant i32 32
29 @g1 = linkonce_odr constant i32 32
31 ; CHECK-DAG: @g2 = internal constant i32 32
32 @g2 = linkonce_odr local_unnamed_addr constant i32 32
34 ; CHECK-DAG: @g3 = internal unnamed_addr constant i32 32
35 @g3 = linkonce_odr unnamed_addr constant i32 32
37 ; CHECK-DAG: @g4 = weak_odr global i32 32
38 @g4 = linkonce_odr global i32 32
40 ; CHECK-DAG: @g5 = weak_odr global i32 32
41 @g5 = linkonce_odr local_unnamed_addr global i32 32
43 ; CHECK-DAG: @g6 = internal unnamed_addr global i32 32
44 @g6 = linkonce_odr unnamed_addr global i32 32
46 @g7 = extern_weak global i32
47 ; CHECK-DAG: @g7 = extern_weak global i32
49 @g8 = external global i32
51 ; CHECK-DAG: define internal void @f1()
53 define hidden void @f1() {
57 ; CHECK-DAG: define hidden void @f2()
58 ; OPT-DAG: define hidden void @f2()
59 define hidden void @f2() {
63 @llvm.used = appending global [1 x i8*] [ i8* bitcast (void ()* @f2 to i8*)]
65 ; CHECK-DAG: define void @f3()
66 ; OPT-DAG: define void @f3()
72 ; CHECK-DAG: define internal void @f4()
74 define linkonce_odr void @f4() local_unnamed_addr {
78 ; CHECK-DAG: define weak_odr void @f5()
79 ; OPT-DAG: define weak_odr void @f5()
80 define linkonce_odr void @f5() {
83 @g9 = global void()* @f5
85 ; CHECK-DAG: define internal void @f6() unnamed_addr
86 ; OPT-DAG: define internal void @f6() unnamed_addr
87 define linkonce_odr void @f6() unnamed_addr {
90 @g10 = global void()* @f6
117 ; RES: .o,g10,px{{$}}