Home | History | Annotate | Download | only in X86
      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 
     26 target triple = "x86_64-unknown-linux-gnu"
     27 
     28 ; CHECK-DAG: @g1 = linkonce_odr constant i32 32
     29 @g1 = linkonce_odr constant i32 32
     30 
     31 ; CHECK-DAG: @g2 = internal local_unnamed_addr constant i32 32
     32 @g2 = linkonce_odr local_unnamed_addr constant i32 32
     33 
     34 ; CHECK-DAG: @g3 = internal unnamed_addr constant i32 32
     35 @g3 = linkonce_odr unnamed_addr constant i32 32
     36 
     37 ; CHECK-DAG: @g4 = linkonce_odr global i32 32
     38 @g4 = linkonce_odr global i32 32
     39 
     40 ; CHECK-DAG: @g5 = linkonce_odr local_unnamed_addr global i32 32
     41 @g5 = linkonce_odr local_unnamed_addr global i32 32
     42 
     43 ; CHECK-DAG: @g6 = internal unnamed_addr global i32 32
     44 @g6 = linkonce_odr unnamed_addr global i32 32
     45 
     46 @g7 = extern_weak global i32
     47 ; CHECK-DAG: @g7 = extern_weak global i32
     48 
     49 @g8 = external global i32
     50 
     51 ; CHECK-DAG: define internal void @f1()
     52 ; OPT2-NOT: @f1
     53 define hidden void @f1() {
     54   ret void
     55 }
     56 
     57 ; CHECK-DAG: define hidden void @f2()
     58 ; OPT-DAG: define hidden void @f2()
     59 define hidden void @f2() {
     60   ret void
     61 }
     62 
     63 @llvm.used = appending global [1 x i8*] [ i8* bitcast (void ()* @f2 to i8*)]
     64 
     65 ; CHECK-DAG: define void @f3()
     66 ; OPT-DAG: define void @f3()
     67 define void @f3() {
     68   call void @f4()
     69   ret void
     70 }
     71 
     72 ; CHECK-DAG: define internal void @f4()
     73 ; OPT2-NOT: @f4
     74 define linkonce_odr void @f4() local_unnamed_addr {
     75   ret void
     76 }
     77 
     78 ; CHECK-DAG: define linkonce_odr void @f5()
     79 ; OPT-DAG: define linkonce_odr void @f5()
     80 define linkonce_odr void @f5() {
     81   ret void
     82 }
     83 @g9 = global void()* @f5
     84 
     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 {
     88   ret void
     89 }
     90 @g10 = global void()* @f6
     91 
     92 define i32* @f7() {
     93   ret i32* @g7
     94 }
     95 
     96 define i32* @f8() {
     97   ret i32* @g8
     98 }
     99 
    100 ; API: f1 PREVAILING_DEF_IRONLY
    101 ; API: f2 PREVAILING_DEF_IRONLY
    102 ; API: f3 PREVAILING_DEF_IRONLY_EXP
    103 ; API: f4 PREVAILING_DEF_IRONLY_EXP
    104 ; API: f5 PREVAILING_DEF_IRONLY_EXP
    105 ; API: f6 PREVAILING_DEF_IRONLY_EXP
    106 ; API: f7 PREVAILING_DEF_IRONLY_EXP
    107 ; API: f8 PREVAILING_DEF_IRONLY_EXP
    108 ; API: g7 UNDEF
    109 ; API: g8 UNDEF
    110 ; API: g9 PREVAILING_DEF_IRONLY_EXP
    111 ; API: g10 PREVAILING_DEF_IRONLY_EXP
    112