diff options
author | Stephen Hines <srhines@google.com> | 2014-05-29 02:49:00 -0700 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2014-05-29 02:49:00 -0700 |
commit | dce4a407a24b04eebc6a376f8e62b41aaa7b071f (patch) | |
tree | dcebc53f2b182f145a2e659393bf9a0472cedf23 /test/Linker | |
parent | 220b921aed042f9e520c26cffd8282a94c66c3d5 (diff) | |
download | external_llvm-dce4a407a24b04eebc6a376f8e62b41aaa7b071f.zip external_llvm-dce4a407a24b04eebc6a376f8e62b41aaa7b071f.tar.gz external_llvm-dce4a407a24b04eebc6a376f8e62b41aaa7b071f.tar.bz2 |
Update LLVM for 3.5 rebase (r209712).
Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
Diffstat (limited to 'test/Linker')
-rw-r--r-- | test/Linker/Inputs/PR8300.b.ll | 2 | ||||
-rw-r--r-- | test/Linker/Inputs/alias.ll | 3 | ||||
-rw-r--r-- | test/Linker/Inputs/cycle.ll | 2 | ||||
-rw-r--r-- | test/Linker/Inputs/datalayout-b.ll | 2 | ||||
-rw-r--r-- | test/Linker/Inputs/old_global_ctors.3.4.bc | bin | 0 -> 368 bytes | |||
-rw-r--r-- | test/Linker/alias.ll | 16 | ||||
-rw-r--r-- | test/Linker/cycle.ll | 7 | ||||
-rw-r--r-- | test/Linker/debug-info-version-a.ll | 16 | ||||
-rw-r--r-- | test/Linker/debug-info-version-b.ll | 10 | ||||
-rw-r--r-- | test/Linker/global_ctors.ll | 29 | ||||
-rw-r--r-- | test/Linker/type-unique-odr-a.ll | 16 |
11 files changed, 95 insertions, 8 deletions
diff --git a/test/Linker/Inputs/PR8300.b.ll b/test/Linker/Inputs/PR8300.b.ll index 9e538f5..362d309 100644 --- a/test/Linker/Inputs/PR8300.b.ll +++ b/test/Linker/Inputs/PR8300.b.ll @@ -1,7 +1,7 @@ %foo = type { [8 x i8] } %bar = type { [9 x i8] } -@zed = alias bitcast (void (%bar*)* @xyz to void (%foo*)*) +@zed = alias void (%foo*), void (%bar*)* @xyz define void @xyz(%bar* %this) { entry: diff --git a/test/Linker/Inputs/alias.ll b/test/Linker/Inputs/alias.ll new file mode 100644 index 0000000..b869cae --- /dev/null +++ b/test/Linker/Inputs/alias.ll @@ -0,0 +1,3 @@ +@zed = global i32 42 +@foo = alias i32* @zed +@foo2 = alias i16, i32* @zed diff --git a/test/Linker/Inputs/cycle.ll b/test/Linker/Inputs/cycle.ll new file mode 100644 index 0000000..d0eddb6 --- /dev/null +++ b/test/Linker/Inputs/cycle.ll @@ -0,0 +1,2 @@ +@foo = alias i32* @bar +@bar = weak global i32 0 diff --git a/test/Linker/Inputs/datalayout-b.ll b/test/Linker/Inputs/datalayout-b.ll index 59cdb68..d76c1aa 100644 --- a/test/Linker/Inputs/datalayout-b.ll +++ b/test/Linker/Inputs/datalayout-b.ll @@ -1 +1 @@ -target datalayout = "E" +target datalayout = "e-p:16:16" diff --git a/test/Linker/Inputs/old_global_ctors.3.4.bc b/test/Linker/Inputs/old_global_ctors.3.4.bc Binary files differnew file mode 100644 index 0000000..a24b1b4 --- /dev/null +++ b/test/Linker/Inputs/old_global_ctors.3.4.bc diff --git a/test/Linker/alias.ll b/test/Linker/alias.ll new file mode 100644 index 0000000..5809a15 --- /dev/null +++ b/test/Linker/alias.ll @@ -0,0 +1,16 @@ +; RUN: llvm-link %s %S/Inputs/alias.ll -S -o - | FileCheck %s +; RUN: llvm-link %S/Inputs/alias.ll %s -S -o - | FileCheck %s + +@foo = weak global i32 0 +; CHECK-DAG: @foo = alias i32* @zed + +@bar = alias i32* @foo +; CHECK-DAG: @bar = alias i32* @zed + +@foo2 = weak global i32 0 +; CHECK-DAG: @foo2 = alias i16, i32* @zed + +@bar2 = alias i32* @foo2 +; CHECK-DAG: @bar2 = alias i32* @zed + +; CHECK-DAG: @zed = global i32 42 diff --git a/test/Linker/cycle.ll b/test/Linker/cycle.ll new file mode 100644 index 0000000..7d9ad2d --- /dev/null +++ b/test/Linker/cycle.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-link %s %S/Inputs/cycle.ll 2>&1 | FileCheck %s +; RUN: not llvm-link %S/Inputs/cycle.ll %s 2>&1 | FileCheck %s + +; CHECK: Linking these modules creates an alias cycle + +@foo = weak global i32 0 +@bar = alias i32* @foo diff --git a/test/Linker/debug-info-version-a.ll b/test/Linker/debug-info-version-a.ll new file mode 100644 index 0000000..c3d9c87 --- /dev/null +++ b/test/Linker/debug-info-version-a.ll @@ -0,0 +1,16 @@ +; RUN: llvm-link %s %p/debug-info-version-b.ll -S -o - | FileCheck %s + +; Test linking of incompatible debug info versions. The debug info +; from the other file should be dropped. + +; CHECK-NOT: metadata !{metadata !"b.c", metadata !""} +; CHECK: metadata !{metadata !"a.c", metadata !""} +; CHECK-NOT: metadata !{metadata !"b.c", metadata !""} + +!llvm.module.flags = !{ !0 } +!llvm.dbg.cu = !{!1} + +!0 = metadata !{i32 2, metadata !"Debug Info Version", i32 1} +!1 = metadata !{i32 589841, metadata !2, i32 12, metadata !"clang", i1 true, metadata !"", i32 0, metadata !3, metadata !3, metadata !3, null, null, metadata !""} ; [ DW_TAG_compile_unit ] +!2 = metadata !{metadata !"a.c", metadata !""} +!3 = metadata !{} diff --git a/test/Linker/debug-info-version-b.ll b/test/Linker/debug-info-version-b.ll new file mode 100644 index 0000000..2b4f184 --- /dev/null +++ b/test/Linker/debug-info-version-b.ll @@ -0,0 +1,10 @@ +; RUN: true +; Companion for debug-info-version-a.ll. + +!llvm.module.flags = !{ !0 } +!llvm.dbg.cu = !{!1} + +!0 = metadata !{i32 2, metadata !"Debug Info Version", i32 42} +!1 = metadata !{i32 589841, metadata !2, i32 12, metadata !"clang", metadata !"I AM UNEXPECTED!"} ; [ DW_TAG_compile_unit ] +!2 = metadata !{metadata !"b.c", metadata !""} +!3 = metadata !{} diff --git a/test/Linker/global_ctors.ll b/test/Linker/global_ctors.ll new file mode 100644 index 0000000..541f0d4 --- /dev/null +++ b/test/Linker/global_ctors.ll @@ -0,0 +1,29 @@ +; RUN: llvm-as %s -o %t.new.bc +; RUN: llvm-link %t.new.bc %S/Inputs/old_global_ctors.3.4.bc | llvm-dis | FileCheck %s + +; old_global_ctors.3.4.bc contains the following LLVM IL, assembled into +; bitcode by llvm-as from 3.4. It uses a two element @llvm.global_ctors array. +; --- +; declare void @a_global_ctor() +; declare void @b_global_ctor() +; +; @llvm.global_ctors = appending global [2 x { i32, void ()* } ] [ +; { i32, void ()* } { i32 65535, void ()* @a_global_ctor }, +; { i32, void ()* } { i32 65535, void ()* @b_global_ctor } +; ] +; --- + +declare void @c_global_ctor() +declare void @d_global_ctor() + +@llvm.global_ctors = appending global [2 x { i32, void ()*, i8* } ] [ + { i32, void ()*, i8* } { i32 65535, void ()* @c_global_ctor, i8* null }, + { i32, void ()*, i8* } { i32 65535, void ()* @d_global_ctor, i8* null } +] + +; CHECK: @llvm.global_ctors = appending global [4 x { i32, void ()*, i8* }] [ +; CHECK-DAG: { i32, void ()*, i8* } { i32 65535, void ()* @a_global_ctor, i8* null } +; CHECK-DAG: { i32, void ()*, i8* } { i32 65535, void ()* @b_global_ctor, i8* null } +; CHECK-DAG: { i32, void ()*, i8* } { i32 65535, void ()* @c_global_ctor, i8* null } +; CHECK-DAG: { i32, void ()*, i8* } { i32 65535, void ()* @d_global_ctor, i8* null } +; CHECK: ] diff --git a/test/Linker/type-unique-odr-a.ll b/test/Linker/type-unique-odr-a.ll index a1b8d28..91c8033 100644 --- a/test/Linker/type-unique-odr-a.ll +++ b/test/Linker/type-unique-odr-a.ll @@ -22,10 +22,6 @@ ; return A().getFoo(); ; } ; -; CHECK: DW_TAG_subprogram -; CHECK-NEXT: DW_AT_MIPS_linkage_name {{.*}} "_Z3bazv" -; CHECK: DW_TAG_subprogram -; CHECK-NEXT: DW_AT_MIPS_linkage_name {{.*}} "_ZL3barv" ; CHECK: DW_TAG_class_type ; CHECK-NEXT: DW_AT_name {{.*}} "A" ; CHECK-NOT: DW_TAG @@ -33,8 +29,16 @@ ; CHECK-NEXT: DW_AT_name {{.*}} "data" ; CHECK-NOT: DW_TAG ; CHECK: DW_TAG_subprogram -; CHECK-NEXT: DW_AT_MIPS_linkage_name {{.*}} "_ZN1A6getFooEv" -; CHECK-NEXT: DW_AT_name {{.*}} "getFoo" +; CHECK-NOT: DW_TAG +; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZN1A6getFooEv" +; CHECK-NOT: DW_TAG +; CHECK: DW_AT_name {{.*}} "getFoo" +; CHECK: DW_TAG_subprogram +; CHECK-NOT: DW_TAG +; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_Z3bazv" +; CHECK: DW_TAG_subprogram +; CHECK-NOT: DW_TAG +; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZL3barv" ; getFoo and A may only appear once. ; CHECK-NOT: {{(getFoo)|("A")}} |