diff options
Diffstat (limited to 'llvm/test')
52 files changed, 79 insertions, 124 deletions
diff --git a/llvm/test/Bitcode/metadata-2.ll b/llvm/test/Bitcode/metadata-2.ll index e9065261043..040087a9a4e 100644 --- a/llvm/test/Bitcode/metadata-2.ll +++ b/llvm/test/Bitcode/metadata-2.ll @@ -2,7 +2,7 @@ ; RUN: verify-uselistorder < %s %0 = type { %object.ModuleInfo.__vtbl*, i8*, %"byte[]", %1, %"ClassInfo[]", i32, void ()*, void ()*, void ()*, i8*, void ()* } ; type %0 %1 = type { i64, %object.ModuleInfo* } ; type %1 - %2 = type { i32, void ()* } ; type %2 + %2 = type { i32, void ()*, i8* } ; type %2 %"ClassInfo[]" = type { i64, %object.ClassInfo** } %"Interface[]" = type { i64, %object.Interface* } %"ModuleInfo[]" = type { i64, %object.ModuleInfo** } @@ -24,7 +24,7 @@ @_D5tango4core8BitManip8__ModuleZ = global %0 { %object.ModuleInfo.__vtbl* @_D10ModuleInfo6__vtblZ, i8* null, %"byte[]" { i64 19, i8* getelementptr ([20 x i8], [20 x i8]* @.str, i32 0, i32 0) }, %1 zeroinitializer, %"ClassInfo[]" zeroinitializer, i32 4, void ()* null, void ()* null, void ()* null, i8* null, void ()* null } ; <%0*> [#uses=1] @_D5tango4core8BitManip11__moduleRefZ = internal global %ModuleReference { %ModuleReference* null, %object.ModuleInfo* bitcast (%0* @_D5tango4core8BitManip8__ModuleZ to %object.ModuleInfo*) } ; <%ModuleReference*> [#uses=2] @_Dmodule_ref = external global %ModuleReference* ; <%ModuleReference**> [#uses=2] -@llvm.global_ctors = appending constant [1 x %2] [%2 { i32 65535, void ()* @_D5tango4core8BitManip16__moduleinfoCtorZ }] ; <[1 x %2]*> [#uses=0] +@llvm.global_ctors = appending constant [1 x %2] [%2 { i32 65535, void ()* @_D5tango4core8BitManip16__moduleinfoCtorZ, i8* null }] ; <[1 x %2]*> [#uses=0] define fastcc i32 @_D5tango4core8BitManip6popcntFkZi(i32 %x_arg) nounwind readnone { entry: diff --git a/llvm/test/Bitcode/upgrade-global-ctors.ll b/llvm/test/Bitcode/upgrade-global-ctors.ll index d7afcdd0c18..372b4646498 100644 --- a/llvm/test/Bitcode/upgrade-global-ctors.ll +++ b/llvm/test/Bitcode/upgrade-global-ctors.ll @@ -1,5 +1,5 @@ ; RUN: llvm-dis < %s.bc| FileCheck %s ; RUN: verify-uselistorder < %s.bc -; Global constructors should no longer be upgraded when reading bitcode. -; CHECK: @llvm.global_ctors = appending global [0 x { i32, void ()* }] zeroinitializer +; The 2-field form @llvm.global_ctors will be upgraded when reading bitcode. +; CHECK: @llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer diff --git a/llvm/test/Bitcode/upgrade-global-dtors.ll b/llvm/test/Bitcode/upgrade-global-dtors.ll new file mode 100644 index 00000000000..a0879bd1b8b --- /dev/null +++ b/llvm/test/Bitcode/upgrade-global-dtors.ll @@ -0,0 +1,5 @@ +; RUN: llvm-dis < %s.bc | FileCheck %s +; RUN: verify-uselistorder < %s.bc + +; The 2-field form @llvm.global_dtors will be upgraded when reading bitcode. +; CHECK: @llvm.global_dtors = appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* null, i8* null }, { i32, void ()*, i8* } { i32 65534, void ()* null, i8* null }] diff --git a/llvm/test/Bitcode/upgrade-global-dtors.ll.bc b/llvm/test/Bitcode/upgrade-global-dtors.ll.bc Binary files differnew file mode 100644 index 00000000000..39a6b3a52ff --- /dev/null +++ b/llvm/test/Bitcode/upgrade-global-dtors.ll.bc diff --git a/llvm/test/CodeGen/AArch64/init-array.ll b/llvm/test/CodeGen/AArch64/init-array.ll index a275e7ecc57..825f1ad0b23 100644 --- a/llvm/test/CodeGen/AArch64/init-array.ll +++ b/llvm/test/CodeGen/AArch64/init-array.ll @@ -5,6 +5,6 @@ define internal void @_GLOBAL__I_a() section ".text.startup" { ret void } -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_a, i8* null }] ; CHECK: .section .init_array diff --git a/llvm/test/CodeGen/ARM/ctor_order.ll b/llvm/test/CodeGen/ARM/ctor_order.ll index 0cf87d7a97b..ca14b3ac3f1 100644 --- a/llvm/test/CodeGen/ARM/ctor_order.ll +++ b/llvm/test/CodeGen/ARM/ctor_order.ll @@ -21,7 +21,7 @@ ; GNUEABI: .long f152 -@llvm.global_ctors = appending global [2 x { i32, void ()* }] [ { i32, void ()* } { i32 151, void ()* @f151 }, { i32, void ()* } { i32 152, void ()* @f152 } ] +@llvm.global_ctors = appending global [2 x { i32, void ()*, i8* }] [ { i32, void ()*, i8* } { i32 151, void ()* @f151, i8* null }, { i32, void ()*, i8* } { i32 152, void ()* @f152, i8* null } ] define void @f151() { entry: diff --git a/llvm/test/CodeGen/ARM/ctors_dtors.ll b/llvm/test/CodeGen/ARM/ctors_dtors.ll index c097ade3c84..1320ee22851 100644 --- a/llvm/test/CodeGen/ARM/ctors_dtors.ll +++ b/llvm/test/CodeGen/ARM/ctors_dtors.ll @@ -11,8 +11,8 @@ ; GNUEABI: .section .init_array,"aw",%init_array ; GNUEABI: .section .fini_array,"aw",%fini_array -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @__mf_init } ] ; <[1 x { i32, void ()* }]*> [#uses=0] -@llvm.global_dtors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @__mf_fini } ] ; <[1 x { i32, void ()* }]*> [#uses=0] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [ { i32, void ()*, i8* } { i32 65535, void ()* @__mf_init, i8* null } ] ; <[1 x { i32, void ()*, i8* }]*> [#uses=0] +@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [ { i32, void ()*, i8* } { i32 65535, void ()* @__mf_fini, i8* null } ] ; <[1 x { i32, void ()*, i8* }]*> [#uses=0] define void @__mf_init() { entry: diff --git a/llvm/test/CodeGen/Mips/init-array.ll b/llvm/test/CodeGen/Mips/init-array.ll index 1ca182dae7a..1f1b4a050d2 100644 --- a/llvm/test/CodeGen/Mips/init-array.ll +++ b/llvm/test/CodeGen/Mips/init-array.ll @@ -2,7 +2,7 @@ target triple = "mipsel-unknown-linux" -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @test }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @test, i8* null }] ; CHECK: .section ; CHECK: .init_array ; CHECK-NOT: .ctors diff --git a/llvm/test/CodeGen/PowerPC/pr17354.ll b/llvm/test/CodeGen/PowerPC/pr17354.ll index 5160d836a26..9b5f52aeed8 100644 --- a/llvm/test/CodeGen/PowerPC/pr17354.ll +++ b/llvm/test/CodeGen/PowerPC/pr17354.ll @@ -10,7 +10,7 @@ target triple = "powerpc64-unknown-linux-gnu" %struct.CS = type { i32 } @_ZL3glb = internal global [1 x %struct.CS] zeroinitializer, align 4 -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_a, i8* null }] define internal void @__cxx_global_var_init() section ".text.startup" { entry: diff --git a/llvm/test/CodeGen/RISCV/init-array.ll b/llvm/test/CodeGen/RISCV/init-array.ll index 1927eeb6d11..a2d176f2276 100644 --- a/llvm/test/CodeGen/RISCV/init-array.ll +++ b/llvm/test/CodeGen/RISCV/init-array.ll @@ -20,7 +20,7 @@ define internal void @_GLOBAL__I_a() section ".text.startup" { ret void } -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_a, i8* null }] ;INITARRAY: section .init_array ;INITARRAY-NOT: .section .ctors diff --git a/llvm/test/CodeGen/SPARC/2008-10-10-InlineAsmMemoryOperand.ll b/llvm/test/CodeGen/SPARC/2008-10-10-InlineAsmMemoryOperand.ll index 07e250b3c98..32ebc02ce20 100644 --- a/llvm/test/CodeGen/SPARC/2008-10-10-InlineAsmMemoryOperand.ll +++ b/llvm/test/CodeGen/SPARC/2008-10-10-InlineAsmMemoryOperand.ll @@ -2,7 +2,7 @@ ; PR 1557 target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-f128:128:128" -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @set_fast_math } ] ; <[1 x { i32, void ()* }]*> [#uses=0] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [ { i32, void ()*, i8* } { i32 65535, void ()* @set_fast_math, i8* null } ] ; <[1 x { i32, void ()*, i8* }]*> [#uses=0] define internal void @set_fast_math() nounwind { entry: diff --git a/llvm/test/CodeGen/X86/2007-06-04-X86-64-CtorAsmBugs.ll b/llvm/test/CodeGen/X86/2007-06-04-X86-64-CtorAsmBugs.ll index 1291dc9e6ed..7cba4c2531c 100644 --- a/llvm/test/CodeGen/X86/2007-06-04-X86-64-CtorAsmBugs.ll +++ b/llvm/test/CodeGen/X86/2007-06-04-X86-64-CtorAsmBugs.ll @@ -3,7 +3,7 @@ %struct.A = type { [1024 x i8] } @_ZN1A1aE = global %struct.A zeroinitializer, align 32 ; <%struct.A*> [#uses=1] -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN1A1aE } ] ; <[1 x { i32, void ()* }]*> [#uses=0] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [ { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__ZN1A1aE, i8* null } ] ; <[1 x { i32, void ()*, i8* null }]*> [#uses=0] define internal void @_GLOBAL__I__ZN1A1aE() section "__TEXT,__StaticInit,regular,pure_instructions" { entry: diff --git a/llvm/test/CodeGen/X86/2011-08-29-InitOrder.ll b/llvm/test/CodeGen/X86/2011-08-29-InitOrder.ll index b278ad67415..2af7b1109f4 100644 --- a/llvm/test/CodeGen/X86/2011-08-29-InitOrder.ll +++ b/llvm/test/CodeGen/X86/2011-08-29-InitOrder.ll @@ -2,7 +2,7 @@ ; RUN: llc < %s -mtriple=i386-apple-darwin | FileCheck %s --check-prefix=CHECK-DARWIN ; PR5329 -@llvm.global_ctors = appending global [3 x { i32, void ()* }] [{ i32, void ()* } { i32 2000, void ()* @construct_2 }, { i32, void ()* } { i32 3000, void ()* @construct_3 }, { i32, void ()* } { i32 1000, void ()* @construct_1 }] +@llvm.global_ctors = appending global [3 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 2000, void ()* @construct_2, i8* null }, { i32, void ()*, i8* } { i32 3000, void ()* @construct_3, i8* null }, { i32, void ()*, i8* } { i32 1000, void ()* @construct_1, i8* null }] ; CHECK-DEFAULT: .section .ctors.64535,"aw",@progbits ; CHECK-DEFAULT: .long construct_1 ; CHECK-DEFAULT: .section .ctors.63535,"aw",@progbits @@ -14,7 +14,7 @@ ; CHECK-DARWIN-NEXT: .long _construct_2 ; CHECK-DARWIN-NEXT: .long _construct_3 -@llvm.global_dtors = appending global [3 x { i32, void ()* }] [{ i32, void ()* } { i32 2000, void ()* @destruct_2 }, { i32, void ()* } { i32 1000, void ()* @destruct_1 }, { i32, void ()* } { i32 3000, void ()* @destruct_3 }] +@llvm.global_dtors = appending global [3 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 2000, void ()* @destruct_2, i8* null }, { i32, void ()*, i8* } { i32 1000, void ()* @destruct_1, i8* null }, { i32, void ()*, i8* } { i32 3000, void ()* @destruct_3, i8* null }] ; CHECK-DEFAULT: .section .dtors.64535,"aw",@progbits ; CHECK-DEFAULT: .long destruct_1 ; CHECK-DEFAULT: .section .dtors.63535,"aw",@progbits diff --git a/llvm/test/CodeGen/X86/init-priority.ll b/llvm/test/CodeGen/X86/init-priority.ll index 85ef5475cf2..30e94841f79 100644 --- a/llvm/test/CodeGen/X86/init-priority.ll +++ b/llvm/test/CodeGen/X86/init-priority.ll @@ -16,7 +16,7 @@ @c1 = global %class.C zeroinitializer, align 1 @d1 = global %class.D zeroinitializer, align 1 -@llvm.global_ctors = appending global [2 x { i32, void ()* }] [{ i32, void ()* } { i32 101, void ()* @_GLOBAL__I_000101 }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] +@llvm.global_ctors = appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 101, void ()* @_GLOBAL__I_000101, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_a, i8* null }] define linkonce_odr void @_ZN1CC1Ev(%class.C* nocapture %this) { entry: diff --git a/llvm/test/CodeGen/X86/negate-add-zero.ll b/llvm/test/CodeGen/X86/negate-add-zero.ll index beb87e3e903..78a4cf89a7e 100644 --- a/llvm/test/CodeGen/X86/negate-add-zero.ll +++ b/llvm/test/CodeGen/X86/negate-add-zero.ll @@ -188,7 +188,6 @@ target triple = "i386-apple-darwin7" @"\01LC28" = external constant [15 x i8] ; <[15 x i8]*> [#uses=0] @"\01LC29" = external constant [20 x i8] ; <[20 x i8]*> [#uses=0] @"\01LC30" = external constant [41 x i8] ; <[41 x i8]*> [#uses=0] -@llvm.global_ctors = external global [1 x { i32, void ()* }] ; <[1 x { i32, void ()* }]*> [#uses=0] declare void @_GLOBAL__I__ZN9HingeNode7DEG2RADE() section "__TEXT,__StaticInit,regular,pure_instructions" diff --git a/llvm/test/DebugInfo/COFF/asan-module-ctor.ll b/llvm/test/DebugInfo/COFF/asan-module-ctor.ll index 8d1f811ad72..83b27305f3f 100644 --- a/llvm/test/DebugInfo/COFF/asan-module-ctor.ll +++ b/llvm/test/DebugInfo/COFF/asan-module-ctor.ll @@ -21,7 +21,7 @@ target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32" target triple = "i686-pc-win32" -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_ctor }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 1, void ()* @asan.module_ctor, i8* null }] ; Function Attrs: nounwind sanitize_address define i32 @foo() #0 !dbg !4 { diff --git a/llvm/test/DebugInfo/COFF/asan-module-without-functions.ll b/llvm/test/DebugInfo/COFF/asan-module-without-functions.ll index 9e3c25e80a8..f009e301558 100644 --- a/llvm/test/DebugInfo/COFF/asan-module-without-functions.ll +++ b/llvm/test/DebugInfo/COFF/asan-module-without-functions.ll @@ -14,11 +14,11 @@ target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32" target triple = "i686-pc-win32" @c = global { i8, [63 x i8] } { i8 42, [63 x i8] zeroinitializer }, align 32 -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_ctor }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 1, void ()* @asan.module_ctor, i8* null }] @___asan_gen_ = private constant [7 x i8] c"asan.c\00", align 1 @___asan_gen_1 = private unnamed_addr constant [2 x i8] c"c\00", align 1 @0 = internal global [1 x { i32, i32, i32, i32, i32, i32 }] [{ i32, i32, i32, i32, i32, i32 } { i32 ptrtoint ({ i8, [63 x i8] }* @c to i32), i32 1, i32 64, i32 ptrtoint ([2 x i8]* @___asan_gen_1 to i32), i32 ptrtoint ([7 x i8]* @___asan_gen_ to i32), i32 0 }] -@llvm.global_dtors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_dtor }] +@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 1, void ()* @asan.module_dtor, i8* null }] define internal void @asan.module_ctor() { call void @__asan_init_v3() diff --git a/llvm/test/DebugInfo/Generic/incorrect-variable-debugloc.ll b/llvm/test/DebugInfo/Generic/incorrect-variable-debugloc.ll index c6143a53649..e8a50d067ba 100644 --- a/llvm/test/DebugInfo/Generic/incorrect-variable-debugloc.ll +++ b/llvm/test/DebugInfo/Generic/incorrect-variable-debugloc.ll @@ -52,7 +52,7 @@ %struct.B = type { i32 } %struct.A = type { i8 } -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_ctor }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 1, void ()* @asan.module_ctor, i8* null }] @__asan_option_detect_stack_use_after_return = external global i32 @___asan_gen_ = private unnamed_addr constant [11 x i8] c"1 32 8 1 A\00", align 1 @___asan_gen_1 = private unnamed_addr constant [13 x i8] c"1 32 1 3 tmp\00", align 1 diff --git a/llvm/test/DebugInfo/X86/cu-ranges-odr.ll b/llvm/test/DebugInfo/X86/cu-ranges-odr.ll index 4582cc29d43..896fae71522 100644 --- a/llvm/test/DebugInfo/X86/cu-ranges-odr.ll +++ b/llvm/test/DebugInfo/X86/cu-ranges-odr.ll @@ -23,7 +23,7 @@ source_filename = "test/DebugInfo/X86/cu-ranges-odr.ll" %class.A = type { i32 } @a = global %class.A zeroinitializer, align 4, !dbg !0 -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_a, i8* null }] define internal void @__cxx_global_var_init() section ".text.startup" !dbg !18 { entry: diff --git a/llvm/test/DebugInfo/X86/dbg_value_direct.ll b/llvm/test/DebugInfo/X86/dbg_value_direct.ll index e95fa7b28a4..f9e3d766723 100644 --- a/llvm/test/DebugInfo/X86/dbg_value_direct.ll +++ b/llvm/test/DebugInfo/X86/dbg_value_direct.ll @@ -19,7 +19,7 @@ target triple = "x86_64-unknown-linux-gnu" @__asan_mapping_offset = linkonce_odr constant i64 2147450880 @__asan_mapping_scale = linkonce_odr constant i64 3 -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_ctor }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 1, void ()* @asan.module_ctor, i8* null }] @___asan_gen_ = private unnamed_addr constant [16 x i8] c"1 32 4 5 .addr \00", align 1 ; Function Attrs: sanitize_address uwtable diff --git a/llvm/test/DebugInfo/X86/debug-ranges-offset.ll b/llvm/test/DebugInfo/X86/debug-ranges-offset.ll index 6a601716dc3..ce74406a1c6 100644 --- a/llvm/test/DebugInfo/X86/debug-ranges-offset.ll +++ b/llvm/test/DebugInfo/X86/debug-ranges-offset.ll @@ -6,7 +6,7 @@ ; low_pc for the compile unit. ; CHECK-NOT: .rela.debug_ranges -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 0, void ()* @__msan_init }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__msan_init, i8* null }] @str = private unnamed_addr constant [4 x i8] c"zzz\00" @__msan_retval_tls = external thread_local(initialexec) global [8 x i64] @__msan_retval_origin_tls = external thread_local(initialexec) global i32 diff --git a/llvm/test/DebugInfo/X86/generate-odr-hash.ll b/llvm/test/DebugInfo/X86/generate-odr-hash.ll index e1d3df4e5cd..af905c37605 100644 --- a/llvm/test/DebugInfo/X86/generate-odr-hash.ll +++ b/llvm/test/DebugInfo/X86/generate-odr-hash.ll @@ -181,7 +181,7 @@ source_filename = "test/DebugInfo/X86/generate-odr-hash.ll" @_ZN7echidna8capybara8mongoose6animalE = global %"class.echidna::capybara::mongoose::fluffy" zeroinitializer, align 4, !dbg !6 @w = internal global %"struct.<anonymous namespace>::walrus" zeroinitializer, align 1, !dbg !16 @wom = global %struct.wombat zeroinitializer, align 4, !dbg !25 -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_a, i8* null }] ; Function Attrs: nounwind uwtable define void @_Z3foov() #0 !dbg !40 { diff --git a/llvm/test/Feature/global_pv.ll b/llvm/test/Feature/global_pv.ll index 34b9a7df882..f1a7b7fd356 100644 --- a/llvm/test/Feature/global_pv.ll +++ b/llvm/test/Feature/global_pv.ll @@ -3,8 +3,8 @@ @G1 = global i32 zeroinitializer @G2 = global i32 zeroinitializer @g = global <2 x i32*> zeroinitializer -%0 = type { i32, void ()* } -@llvm.global_ctors = appending global [1 x %0] [%0 { i32 65535, void ()* @test }] +%0 = type { i32, void ()*, i8* } +@llvm.global_ctors = appending global [1 x %0] [%0 { i32 65535, void ()* @test, i8* null }] define internal void @test() { %A = insertelement <2 x i32*> undef, i32* @G1, i32 0 %B = insertelement <2 x i32*> %A, i32* @G2, i32 1 diff --git a/llvm/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll b/llvm/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll index 16e9ea04f09..d392662efc7 100644 --- a/llvm/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll +++ b/llvm/test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll @@ -26,7 +26,7 @@ entry: ret void } -@llvm.global_ctors = appending global [2 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @__late_ctor }, { i32, void ()* } { i32 0, void ()* @__early_ctor }] +@llvm.global_ctors = appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__late_ctor, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @__early_ctor, i8* null }] define internal void @__late_ctor() sanitize_address section ".text.startup" { entry: diff --git a/llvm/test/Instrumentation/MemorySanitizer/global_ctors_2to3.ll b/llvm/test/Instrumentation/MemorySanitizer/global_ctors_2to3.ll deleted file mode 100644 index d841c6c05c9..00000000000 --- a/llvm/test/Instrumentation/MemorySanitizer/global_ctors_2to3.ll +++ /dev/null @@ -1,18 +0,0 @@ -; MSan converts 2-element global_ctors to 3-element when adding the new entry. -; RUN: opt < %s -msan-with-comdat -S -passes=msan 2>&1 | FileCheck %s -; RUN: opt < %s -msan -msan-with-comdat -S | FileCheck %s - -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -; CHECK: $msan.module_ctor = comdat any -; CHECK: @llvm.global_ctors = appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @f, i8* null }, { i32, void ()*, i8* } { i32 0, void ()* @msan.module_ctor, i8* bitcast (void ()* @msan.module_ctor to i8*) }] - -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @f }] - -define internal void @f() { -entry: - ret void -} - -; CHECK: define internal void @msan.module_ctor() comdat { diff --git a/llvm/test/Linker/ctors5.ll b/llvm/test/Linker/ctors5.ll deleted file mode 100644 index 99124061bb3..00000000000 --- a/llvm/test/Linker/ctors5.ll +++ /dev/null @@ -1,8 +0,0 @@ -; RUN: llvm-link -S %s | FileCheck %s - -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @f }] -; CHECK: @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @f, i8* null }] - -define void @f() { - ret void -} diff --git a/llvm/test/Linker/global_ctors.ll b/llvm/test/Linker/global_ctors.ll deleted file mode 100644 index cc28471df59..00000000000 --- a/llvm/test/Linker/global_ctors.ll +++ /dev/null @@ -1,29 +0,0 @@ -; RUN: llvm-link -S %s %S/Inputs/old_global_ctors.3.4.bc | FileCheck %s -; RUN: llvm-link -S %S/Inputs/old_global_ctors.3.4.bc %s | 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/llvm/test/MC/ARM/cxx-global-constructor.ll b/llvm/test/MC/ARM/cxx-global-constructor.ll index 4afd1e19ad4..02324338908 100644 --- a/llvm/test/MC/ARM/cxx-global-constructor.ll +++ b/llvm/test/MC/ARM/cxx-global-constructor.ll @@ -2,7 +2,7 @@ ; RUN: -filetype=obj -o - | llvm-readobj -r | FileCheck %s -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @f }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @f, i8* null }] define void @f() { ret void diff --git a/llvm/test/Transforms/GlobalDCE/global_ctors.ll b/llvm/test/Transforms/GlobalDCE/global_ctors.ll index bd1a97e6ec2..37d1c8d37c8 100644 --- a/llvm/test/Transforms/GlobalDCE/global_ctors.ll +++ b/llvm/test/Transforms/GlobalDCE/global_ctors.ll @@ -1,12 +1,12 @@ ; RUN: opt -S -globaldce < %s | FileCheck %s ; Test that the presence of debug intrinsics isn't affecting GlobalDCE. -; CHECK: @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_notremovable }] +; CHECK: @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_notremovable, i8* null }] ; CHECK-NOT: @_GLOBAL__I_a declare void @_notremovable() -@llvm.global_ctors = appending global [3 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_b }, { i32, void ()* } { i32 65535, void ()* @_notremovable }] +@llvm.global_ctors = appending global [3 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_a, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_b, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_notremovable, i8* null }] @x = internal unnamed_addr constant i8 undef, align 1 diff --git a/llvm/test/Transforms/GlobalDCE/global_ctors_integration.ll b/llvm/test/Transforms/GlobalDCE/global_ctors_integration.ll index f7f702a980d..47a1d0d1ab5 100644 --- a/llvm/test/Transforms/GlobalDCE/global_ctors_integration.ll +++ b/llvm/test/Transforms/GlobalDCE/global_ctors_integration.ll @@ -9,7 +9,7 @@ @foo = global %class.Foo zeroinitializer, align 4 @_ZN3Bar18LINKER_INITIALIZEDE = external constant i32 -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_a, i8* null }] define internal void @__cxx_global_var_init() section "__TEXT,__StaticInit,regular,pure_instructions" { %1 = load i32, i32* @_ZN3Bar18LINKER_INITIALIZEDE, align 4 diff --git a/llvm/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll b/llvm/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll index 419ae101966..a8531964fb1 100644 --- a/llvm/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll +++ b/llvm/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll @@ -16,7 +16,7 @@ target triple = "i686-pc-linux-gnu" %"struct.std::vector<int,std::allocator<int> >" = type { %"struct.std::_Vector_base<int,std::allocator<int> >" } @registry_lock = external global %struct..0FileDescriptor ; <%struct..0FileDescriptor*> [#uses=0] @_ZN61FLAG__foo_int32_44FLAGS_E = external global %"struct.FlagRegisterer<bool>" ; <%"struct.FlagRegisterer<bool>"*> [#uses=0] -@llvm.global_ctors = appending global [20 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_10FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN60FLAG__foo_bool_19FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZNK5Bzh4Enum13is_contiguousEv }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_21FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN7ScannerC2Ev }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__Z11StripStringPSsPKcc }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZNK9__gnu_cxx4hashI11StringPieceEclERKS1_ }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN8Hasher325ResetEj }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__Z25ACLRv }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int64_25FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_7FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_18FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_25FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_eventbuf }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_26FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_16FLAGS_E }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__ZN17InitializerC2EPKcS1_PFvvE }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__checker_bcad_variable } ] ; <[20 x { i32, void ()* }]*> [#uses=0] +@llvm.global_ctors = appending global [20 x { i32, void ()*, i8* }] [ { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_10FLAGS_E, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__ZN60FLAG__foo_bool_19FLAGS_E, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__ZNK5Bzh4Enum13is_contiguousEv, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_21FLAGS_E, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__ZN7ScannerC2Ev, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__Z11StripStringPSsPKcc, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__ZNK9__gnu_cxx4hashI11StringPieceEclERKS1_, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__ZN8Hasher325ResetEj, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__Z25ACLRv, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int64_25FLAGS_E, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_7FLAGS_E, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_18FLAGS_E, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_17FLAGS_E, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_25FLAGS_E, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_eventbuf, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__ZN61FLAG__foo_int32_26FLAGS_E, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__ZN62FLAG__foo_string_16FLAGS_E, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__ZN17InitializerC2EPKcS1_PFvvE, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__checker_bcad_variable, i8* null } ] ; <[20 x { i32, void ()*, i8* }]*> [#uses=0] declare void @_GLOBAL__I__ZN62FLAG__foo_string_10FLAGS_E() diff --git a/llvm/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll b/llvm/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll index f6e0bb70d63..0c9927f680b 100644 --- a/llvm/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll +++ b/llvm/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll @@ -9,8 +9,8 @@ target triple = "i686-pc-linux-gnu" %"struct.std::_Rb_tree_node_base" = type { i32, %"struct.std::_Rb_tree_node_base"*, %"struct.std::_Rb_tree_node_base"*, %"struct.std::_Rb_tree_node_base"* } %"struct.std::map<int,int,std::less<int>,std::allocator<std::pair<const int, int> > >" = type { %"struct.std::_Rb_tree<int,std::pair<const int, int>,std::_Select1st<std::pair<const int, int> >,std::less<int>,std::allocator<std::pair<const int, int> > >" } @someMap = global %"struct.std::map<int,int,std::less<int>,std::allocator<std::pair<const int, int> > >" zeroinitializer ; <%"struct.std::map<int,int,std::less<int>,std::allocator<std::pair<const int, int> > >"*> [#uses=1] -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_someMap } ] ; <[1 x { i32, void ()* }]*> [#uses=0] -@llvm.global_dtors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @_GLOBAL__D_someMap } ] ; <[1 x { i32, void ()* }]*> [#uses=0] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [ { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_someMap, i8* null } ] ; <[1 x { i32, void ()*, i8* }]*> [#uses=0] +@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [ { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__D_someMap, i8* null } ] ; <[1 x { i32, void ()*, i8* }]*> [#uses=0] define void @_GLOBAL__I_someMap() { entry: diff --git a/llvm/test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll b/llvm/test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll index c88dc1c2d12..f09ab9a2018 100644 --- a/llvm/test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll +++ b/llvm/test/Transforms/GlobalOpt/2010-10-19-WeakOdr.ll @@ -6,7 +6,7 @@ @SomeVar = weak_odr global i32 0 -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @CTOR } ] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [ { i32, void ()*, i8* } { i32 65535, void ()* @CTOR, i8* null } ] define internal void @CTOR() { store i32 23, i32* @SomeVar diff --git a/llvm/test/Transforms/GlobalOpt/2011-04-09-EmptyGlobalCtors.ll b/llvm/test/Transforms/GlobalOpt/2011-04-09-EmptyGlobalCtors.ll index 321a487cc82..42818d6ccc2 100644 --- a/llvm/test/Transforms/GlobalOpt/2011-04-09-EmptyGlobalCtors.ll +++ b/llvm/test/Transforms/GlobalOpt/2011-04-09-EmptyGlobalCtors.ll @@ -1,5 +1,5 @@ ; RUN: opt < %s -globalopt -disable-output -%0 = type { i32, void ()* } +%0 = type { i32, void ()*, i8* } @llvm.global_ctors = appending global [0 x %0] zeroinitializer diff --git a/llvm/test/Transforms/GlobalOpt/assume.ll b/llvm/test/Transforms/GlobalOpt/assume.ll index b15106bc83a..cb41b67e346 100644 --- a/llvm/test/Transforms/GlobalOpt/assume.ll +++ b/llvm/test/Transforms/GlobalOpt/assume.ll @@ -2,7 +2,7 @@ ; CHECK: @tmp = local_unnamed_addr global i32 42 -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_a, i8* null }] @tmp = global i32 0 define i32 @TheAnswerToLifeTheUniverseAndEverything() { diff --git a/llvm/test/Transforms/GlobalOpt/constantfold-initializers.ll b/llvm/test/Transforms/GlobalOpt/constantfold-initializers.ll index 3c20353d157..9f57abcb16f 100644 --- a/llvm/test/Transforms/GlobalOpt/constantfold-initializers.ll +++ b/llvm/test/Transforms/GlobalOpt/constantfold-initializers.ll @@ -94,10 +94,10 @@ define internal void @test6() { } @llvm.global_ctors = appending constant - [6 x { i32, void ()* }] - [{ i32, void ()* } { i32 65535, void ()* @test1 }, - { i32, void ()* } { i32 65535, void ()* @test2 }, - { i32, void ()* } { i32 65535, void ()* @test3 }, - { i32, void ()* } { i32 65535, void ()* @test4 }, - { i32, void ()* } { i32 65535, void ()* @test5 }, - { i32, void ()* } { i32 65535, void ()* @test6 }] + [6 x { i32, void ()*, i8* }] + [{ i32, void ()*, i8* } { i32 65535, void ()* @test1, i8* null }, + { i32, void ()*, i8* } { i32 65535, void ()* @test2, i8* null }, + { i32, void ()*, i8* } { i32 65535, void ()* @test3, i8* null }, + { i32, void ()*, i8* } { i32 65535, void ()* @test4, i8* null }, + { i32, void ()*, i8* } { i32 65535, void ()* @test5, i8* null }, + { i32, void ()*, i8* } { i32 65535, void ()* @test6, i8* null }] diff --git a/llvm/test/Transforms/GlobalOpt/crash.ll b/llvm/test/Transforms/GlobalOpt/crash.ll index 8cfe9ea0570..e9ad7e0d043 100644 --- a/llvm/test/Transforms/GlobalOpt/crash.ll +++ b/llvm/test/Transforms/GlobalOpt/crash.ll @@ -2,12 +2,12 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32" target triple = "i386-apple-darwin9.8" -%0 = type { i32, void ()* } +%0 = type { i32, void ()*, i8* } %struct.btSimdScalar = type { %"union.btSimdScalar::$_14" } %"union.btSimdScalar::$_14" = type { <4 x float> } @_ZL6vTwist = global %struct.btSimdScalar zeroinitializer ; <%struct.btSimdScalar*> [#uses=1] -@llvm.global_ctors = appending global [1 x %0] [%0 { i32 65535, void ()* @_GLOBAL__I__ZN21btConeTwistConstraintC2Ev }] ; <[12 x %0]*> [#uses=0] +@llvm.global_ctors = appending global [1 x %0] [%0 { i32 65535, void ()* @_GLOBAL__I__ZN21btConeTwistConstraintC2Ev, i8* null }] ; <[12 x %0]*> [#uses=0] define internal void @_GLOBAL__I__ZN21btConeTwistConstraintC2Ev() nounwind section "__TEXT,__StaticInit,regular,pure_instructions" { entry: diff --git a/llvm/test/Transforms/GlobalOpt/ctor-list-opt-constexpr.ll b/llvm/test/Transforms/GlobalOpt/ctor-list-opt-constexpr.ll index 0c3ff68a437..bc9ac5b7872 100644 --- a/llvm/test/Transforms/GlobalOpt/ctor-list-opt-constexpr.ll +++ b/llvm/test/Transforms/GlobalOpt/ctor-list-opt-constexpr.ll @@ -2,7 +2,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" target triple = "x86_64-apple-darwin10.0.0" -%0 = type { i32, void ()* } +%0 = type { i32, void ()*, i8* } %struct.foo = type { i32* } %struct.bar = type { i128 } @@ -10,7 +10,7 @@ target triple = "x86_64-apple-darwin10.0.0" @H = global i32 0, align 4 @X = global %struct.foo zeroinitializer, align 8 @X2 = global %struct.bar zeroinitializer, align 8 -@llvm.global_ctors = appending global [2 x %0] [%0 { i32 65535, void ()* @init1 }, %0 { i32 65535, void ()* @init2 }] +@llvm.global_ctors = appending global [2 x %0] [%0 { i32 65535, void ()* @init1, i8* null }, %0 { i32 65535, void ()* @init2, i8* null }] ; PR8710 - GlobalOpt shouldn't change the global's initializer to have this ; arbitrary constant expression, the code generator can't handle it. diff --git a/llvm/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll b/llvm/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll index b969345710d..d581f535f89 100644 --- a/llvm/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll +++ b/llvm/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll @@ -6,7 +6,7 @@ ; CHECK: @H = local_unnamed_addr global i32 2 ; CHECK: @I = local_unnamed_addr global i32 2 -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @CTOR } ] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [ { i32, void ()*, i8* } { i32 65535, void ()* @CTOR, i8* null } ] @addr = external global i32 @G = internal global [6 x [5 x i32]] zeroinitializer @H = global i32 80 diff --git a/llvm/test/Transforms/GlobalOpt/cxx-dtor.ll b/llvm/test/Transforms/GlobalOpt/cxx-dtor.ll index c43a8e2be2e..50d9ff77b54 100644 --- a/llvm/test/Transforms/GlobalOpt/cxx-dtor.ll +++ b/llvm/test/Transforms/GlobalOpt/cxx-dtor.ll @@ -1,12 +1,12 @@ ; RUN: opt < %s -S -passes='cgscc(inline),function(early-cse),globalopt' | FileCheck %s -%0 = type { i32, void ()* } +%0 = type { i32, void ()*, i8* } %struct.A = type { i8 } %struct.B = type { } @a = global %struct.A zeroinitializer, align 1 @__dso_handle = external global i8* -@llvm.global_ctors = appending global [1 x %0] [%0 { i32 65535, void ()* @_GLOBAL__I_a }] +@llvm.global_ctors = appending global [1 x %0] [%0 { i32 65535, void ()* @_GLOBAL__I_a, i8* null }] ; CHECK-NOT: call i32 @__cxa_atexit diff --git a/llvm/test/Transforms/GlobalOpt/externally-initialized-global-ctr.ll b/llvm/test/Transforms/GlobalOpt/externally-initialized-global-ctr.ll index 2e22ff06444..21603f47101 100644 --- a/llvm/test/Transforms/GlobalOpt/externally-initialized-global-ctr.ll +++ b/llvm/test/Transforms/GlobalOpt/externally-initialized-global-ctr.ll @@ -9,7 +9,7 @@ @"\01L_OBJC_METH_VAR_NAME_40" = internal global [7 x i8] c"print:\00", section "__TEXT,__objc_methname,cstring_literals", align 1 @"\01L_OBJC_SELECTOR_REFERENCES_41" = internal externally_initialized global i8* getelementptr inbounds ([7 x i8], [7 x i8]* @"\01L_OBJC_METH_VAR_NAME_40", i32 0, i32 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip" -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_a, i8* null }] @llvm.used = appending global [2 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @"\01L_OBJC_METH_VAR_NAME_40", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_41" to i8*)] define internal void @__cxx_global_var_init() section "__TEXT,__StaticInit,regular,pure_instructions" { diff --git a/llvm/test/Transforms/GlobalOpt/int_sideeffect.ll b/llvm/test/Transforms/GlobalOpt/int_sideeffect.ll index 59c3a8aa4ba..49198cf695a 100644 --- a/llvm/test/Transforms/GlobalOpt/int_sideeffect.ll +++ b/llvm/test/Transforms/GlobalOpt/int_sideeffect.ll @@ -6,7 +6,7 @@ declare void @llvm.sideeffect() -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @ctor } ] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [ { i32, void ()*, i8* } { i32 65535, void ()* @ctor, i8* null } ] @G = global i32 0 define internal void @ctor() { diff --git a/llvm/test/Transforms/GlobalOpt/invariant-nodatalayout.ll b/llvm/test/Transforms/GlobalOpt/invariant-nodatalayout.ll index d1fbe46257d..bb0b9e9143a 100644 --- a/llvm/test/Transforms/GlobalOpt/invariant-nodatalayout.ll +++ b/llvm/test/Transforms/GlobalOpt/invariant-nodatalayout.ll @@ -13,5 +13,5 @@ define void @ctor1() { } @llvm.global_ctors = appending constant - [1 x { i32, void ()* }] - [ { i32, void ()* } { i32 65535, void ()* @ctor1 } ] + [1 x { i32, void ()*, i8* }] + [ { i32, void ()*, i8* } { i32 65535, void ()* @ctor1, i8* null } ] diff --git a/llvm/test/Transforms/GlobalOpt/invariant.group.ll b/llvm/test/Transforms/GlobalOpt/invariant.group.ll index 8a090cbd0d3..dc6fbdbd5e2 100644 --- a/llvm/test/Transforms/GlobalOpt/invariant.group.ll +++ b/llvm/test/Transforms/GlobalOpt/invariant.group.ll @@ -11,7 +11,7 @@ @tmp3 = global i32 0 @ptrToTmp3 = global i32* null -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_a, i8* null }] define i32 @TheAnswerToLifeTheUniverseAndEverything() { ret i32 42 diff --git a/llvm/test/Transforms/GlobalOpt/invariant.ll b/llvm/test/Transforms/GlobalOpt/invariant.ll index 02ffe2bc424..309562b17ff 100644 --- a/llvm/test/Transforms/GlobalOpt/invariant.ll +++ b/llvm/test/Transforms/GlobalOpt/invariant.ll @@ -52,8 +52,8 @@ define void @ctor4() { @llvm.global_ctors = appending constant - [4 x { i32, void ()* }] - [ { i32, void ()* } { i32 65535, void ()* @ctor1 }, - { i32, void ()* } { i32 65535, void ()* @ctor2 }, - { i32, void ()* } { i32 65535, void ()* @ctor3 }, - { i32, void ()* } { i32 65535, void ()* @ctor4 } ] + [4 x { i32, void ()*, i8* }] + [ { i32, void ()*, i8* } { i32 65535, void ()* @ctor1, i8* null }, + { i32, void ()*, i8* } { i32 65535, void ()* @ctor2, i8* null }, + { i32, void ()*, i8* } { i32 65535, void ()* @ctor3, i8* null }, + { i32, void ()*, i8* } { i32 65535, void ()* @ctor4, i8* null } ] diff --git a/llvm/test/Transforms/GlobalOpt/invoke.ll b/llvm/test/Transforms/GlobalOpt/invoke.ll index a3019939735..c54c7aad924 100644 --- a/llvm/test/Transforms/GlobalOpt/invoke.ll +++ b/llvm/test/Transforms/GlobalOpt/invoke.ll @@ -4,7 +4,7 @@ ; Globalopt should be able to evaluate an invoke. ; CHECK: @tmp = local_unnamed_addr global i32 1 -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_a, i8* null }] @tmp = global i32 0 define i32 @one() { diff --git a/llvm/test/Transforms/GlobalOpt/memset-null.ll b/llvm/test/Transforms/GlobalOpt/memset-null.ll index 32bd21cfc58..fb2c5104a6c 100644 --- a/llvm/test/Transforms/GlobalOpt/memset-null.ll +++ b/llvm/test/Transforms/GlobalOpt/memset-null.ll @@ -1,12 +1,12 @@ ; RUN: opt -globalopt -S < %s | FileCheck %s ; PR10047 -%0 = type { i32, void ()* } +%0 = type { i32, void ()*, i8* } %struct.A = type { [100 x i32] } ; CHECK: @a @a = global %struct.A zeroinitializer, align 4 -@llvm.global_ctors = appending global [2 x %0] [%0 { i32 65535, void ()* @_GLOBAL__I_a }, %0 { i32 65535, void ()* @_GLOBAL__I_b }] +@llvm.global_ctors = appending global [2 x %0] [%0 { i32 65535, void ()* @_GLOBAL__I_a, i8* null }, %0 { i32 65535, void ()* @_GLOBAL__I_b, i8* null }] declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) nounwind diff --git a/llvm/test/Transforms/GlobalOpt/undef-init.ll b/llvm/test/Transforms/GlobalOpt/undef-init.ll index 71fad343e56..421a0657ec7 100644 --- a/llvm/test/Transforms/GlobalOpt/undef-init.ll +++ b/llvm/test/Transforms/GlobalOpt/undef-init.ll @@ -1,7 +1,7 @@ ; RUN: opt < %s -globalopt -S | FileCheck %s ; CHECK-NOT: store -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I__Z3foov } ] ; <[1 x { i32, void ()* }]*> [#uses=0] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [ { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I__Z3foov, i8* null } ] ; <[1 x { i32, void ()*, i8* }]*> [#uses=0] @X.0 = internal global i32 undef ; <i32*> [#uses=2] define i32 @_Z3foov() { diff --git a/llvm/test/Transforms/ObjCARC/apelim.ll b/llvm/test/Transforms/ObjCARC/apelim.ll index da3a1f42654..d79fa061fe1 100644 --- a/llvm/test/Transforms/ObjCARC/apelim.ll +++ b/llvm/test/Transforms/ObjCARC/apelim.ll @@ -1,7 +1,7 @@ ; RUN: opt -S -objc-arc-apelim < %s | FileCheck %s ; rdar://10227311 -@llvm.global_ctors = appending global [2 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_x }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_y }] +@llvm.global_ctors = appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_x, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_y, i8* null }] @x = global i32 0 diff --git a/llvm/test/Transforms/ObjCARC/comdat-ipo.ll b/llvm/test/Transforms/ObjCARC/comdat-ipo.ll index 44d7b101049..d7d1d6de097 100644 --- a/llvm/test/Transforms/ObjCARC/comdat-ipo.ll +++ b/llvm/test/Transforms/ObjCARC/comdat-ipo.ll @@ -2,7 +2,7 @@ ; See PR26774 -@llvm.global_ctors = appending global [2 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_x }, { i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_y }] +@llvm.global_ctors = appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_x, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__I_y, i8* null }] @x = global i32 0 diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/unsplittable.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/unsplittable.ll index 46c87bc4e1f..72848bfff5f 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/unsplittable.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/unsplittable.ll @@ -9,7 +9,7 @@ ; BCA-NOT: <GLOBALVAL_SUMMARY_BLOCK ; CHECK: @llvm.global_ctors = appending global -@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @f }] +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @f, i8* null }] ; CHECK: @g = internal global i8 42, !type !0 @g = internal global i8 42, !type !0 diff --git a/llvm/test/Verifier/global-ctors-2.ll b/llvm/test/Verifier/global-ctors-2.ll new file mode 100644 index 00000000000..a811512a931 --- /dev/null +++ b/llvm/test/Verifier/global-ctors-2.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s + +@llvm.global_ctors = appending global [1 x { i32, void()* } ] [ + { i32, void()* } { i32 65535, void ()* null } +] +; CHECK: the third field of the element type is mandatory, specify i8* null to migrate from the obsoleted 2-field form |