aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC/COFF/global_ctors_dtors.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/MC/COFF/global_ctors_dtors.ll')
-rw-r--r--test/MC/COFF/global_ctors_dtors.ll28
1 files changed, 22 insertions, 6 deletions
diff --git a/test/MC/COFF/global_ctors_dtors.ll b/test/MC/COFF/global_ctors_dtors.ll
index 2a25219..046e93a 100644
--- a/test/MC/COFF/global_ctors_dtors.ll
+++ b/test/MC/COFF/global_ctors_dtors.ll
@@ -9,8 +9,13 @@
@.str2 = private unnamed_addr constant [12 x i8] c"destructing\00", align 1
@.str3 = private unnamed_addr constant [5 x i8] c"main\00", align 1
-@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @a_global_ctor }]
-@llvm.global_dtors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @a_global_dtor }]
+%ini = type { i32, void()*, i8* }
+
+@llvm.global_ctors = appending global [2 x %ini ] [
+ %ini { i32 65535, void ()* @a_global_ctor, i8* null },
+ %ini { i32 65535, void ()* @b_global_ctor, i8* bitcast (i32* @b to i8*) }
+]
+@llvm.global_dtors = appending global [1 x %ini ] [%ini { i32 65535, void ()* @a_global_dtor, i8* null }]
declare i32 @puts(i8*)
@@ -19,6 +24,13 @@ define void @a_global_ctor() nounwind {
ret void
}
+@b = global i32 zeroinitializer
+
+define void @b_global_ctor() nounwind {
+ store i32 42, i32* @b
+ ret void
+}
+
define void @a_global_dtor() nounwind {
%1 = call i32 @puts(i8* getelementptr inbounds ([12 x i8]* @.str2, i32 0, i32 0))
ret void
@@ -29,11 +41,15 @@ define i32 @main() nounwind {
ret i32 0
}
-; WIN32: .section .CRT$XCU,"r"
+; WIN32: .section .CRT$XCU,"rd"
; WIN32: a_global_ctor
-; WIN32: .section .CRT$XTX,"r"
+; WIN32: .section .CRT$XCU,"rd",associative .bss,{{_?}}b
+; WIN32: b_global_ctor
+; WIN32: .section .CRT$XTX,"rd"
; WIN32: a_global_dtor
-; MINGW32: .section .ctors,"w"
+; MINGW32: .section .ctors,"wd"
; MINGW32: a_global_ctor
-; MINGW32: .section .dtors,"w"
+; MINGW32: .section .ctors,"wd",associative .bss,{{_?}}b
+; MINGW32: b_global_ctor
+; MINGW32: .section .dtors,"wd"
; MINGW32: a_global_dtor