diff options
Diffstat (limited to 'llvm/test/tools/gold/X86/comdat.ll')
-rw-r--r-- | llvm/test/tools/gold/X86/comdat.ll | 80 |
1 files changed, 42 insertions, 38 deletions
diff --git a/llvm/test/tools/gold/X86/comdat.ll b/llvm/test/tools/gold/X86/comdat.ll index 2170bf89d0c..b5a09d8329c 100644 --- a/llvm/test/tools/gold/X86/comdat.ll +++ b/llvm/test/tools/gold/X86/comdat.ll @@ -1,9 +1,8 @@ -; RUN: llvm-as %s -o %t1.o +; RUN: llvm-as %s -o %t.o ; RUN: llvm-as %p/Inputs/comdat.ll -o %t2.o -; RUN: %gold -shared -o %t3.o -plugin %llvmshlibdir/LLVMgold.so %t1.o %t2.o \ +; RUN: %gold -shared -o %t3.o -plugin %llvmshlibdir/LLVMgold.so %t.o %t2.o \ ; RUN: -plugin-opt=save-temps -; RUN: FileCheck --check-prefix=RES %s < %t3.o.resolution.txt -; RUN: llvm-readobj -t %t3.o | FileCheck --check-prefix=OBJ %s +; RUN: llvm-dis %t3.o.bc -o - | FileCheck %s $c1 = comdat any @@ -25,37 +24,42 @@ bb11: @a14 = alias i16, bitcast (i32 (i8*)* @f1 to i16*) @a15 = alias i16, i16* @a14 -; gold's resolutions should tell us that our $c1 wins, and the other input's $c2 -; wins. f1 is also local due to having protected visibility in the other object. - -; RES: 1.o,f1,plx{{$}} -; RES: 1.o,v1,px{{$}} -; RES: 1.o,r11,px{{$}} -; RES: 1.o,r12,px{{$}} -; RES: 1.o,a11,px{{$}} -; RES: 1.o,a12,px{{$}} -; RES: 1.o,a13,px{{$}} -; RES: 1.o,a14,px{{$}} -; RES: 1.o,a15,px{{$}} - -; RES: 2.o,f1,l{{$}} -; RES: 2.o,will_be_undefined,{{$}} -; RES: 2.o,v1,{{$}} -; RES: 2.o,r21,px{{$}} -; RES: 2.o,r22,px{{$}} -; RES: 2.o,a21,px{{$}} -; RES: 2.o,a22,px{{$}} -; RES: 2.o,a23,px{{$}} -; RES: 2.o,a24,px{{$}} -; RES: 2.o,a25,px{{$}} - -; f1's protected visibility should be reflected in the DSO. - -; OBJ: Name: f1 ( -; OBJ-NEXT: Value: -; OBJ-NEXT: Size: -; OBJ-NEXT: Binding: -; OBJ-NEXT: Type: -; OBJ-NEXT: Other [ -; OBJ-NEXT: STV_PROTECTED -; OBJ-NEXT: ] +; CHECK: $c1 = comdat any +; CHECK: $c2 = comdat any + +; CHECK-DAG: @v1 = weak_odr global i32 42, comdat($c1) + +; CHECK-DAG: @r11 = global i32* @v1{{$}} +; CHECK-DAG: @r12 = global i32 (i8*)* @f1{{$}} + +; CHECK-DAG: @r21 = global i32* @v1{{$}} +; CHECK-DAG: @r22 = global i32 (i8*)* @f1{{$}} + +; CHECK-DAG: @v1.1 = internal global i32 41, comdat($c2) + +; CHECK-DAG: @a11 = alias i32, i32* @v1{{$}} +; CHECK-DAG: @a12 = alias i16, bitcast (i32* @v1 to i16*) + +; CHECK-DAG: @a13 = alias i32 (i8*), i32 (i8*)* @f1{{$}} +; CHECK-DAG: @a14 = alias i16, bitcast (i32 (i8*)* @f1 to i16*) + +; CHECK-DAG: @a21 = alias i32, i32* @v1.1{{$}} +; CHECK-DAG: @a22 = alias i16, bitcast (i32* @v1.1 to i16*) + +; CHECK-DAG: @a23 = alias i32 (i8*), i32 (i8*)* @f1.2{{$}} +; CHECK-DAG: @a24 = alias i16, bitcast (i32 (i8*)* @f1.2 to i16*) + +; CHECK: define weak_odr protected i32 @f1(i8*) comdat($c1) { +; CHECK-NEXT: bb10: +; CHECK-NEXT: br label %bb11{{$}} +; CHECK: bb11: +; CHECK-NEXT: ret i32 42 +; CHECK-NEXT: } + +; CHECK: define internal i32 @f1.2(i8* %this) comdat($c2) { +; CHECK-NEXT: bb20: +; CHECK-NEXT: store i8* %this, i8** null +; CHECK-NEXT: br label %bb21 +; CHECK: bb21: +; CHECK-NEXT: ret i32 41 +; CHECK-NEXT: } |