summaryrefslogtreecommitdiff
path: root/test/COFF/ctors_dtors_priority.s
diff options
context:
space:
mode:
Diffstat (limited to 'test/COFF/ctors_dtors_priority.s')
-rw-r--r--test/COFF/ctors_dtors_priority.s30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/COFF/ctors_dtors_priority.s b/test/COFF/ctors_dtors_priority.s
new file mode 100644
index 000000000000..60562ba57a52
--- /dev/null
+++ b/test/COFF/ctors_dtors_priority.s
@@ -0,0 +1,30 @@
+# REQUIRES: x86
+# RUN: llvm-mc -triple=x86_64-windows-gnu -filetype=obj -o %t.obj %s
+# RUN: lld-link -entry:main %t.obj -out:%t.exe
+# RUN: llvm-objdump -s %t.exe | FileCheck %s
+
+.globl main
+main:
+ nop
+
+.section .ctors.00005, "w"
+ .quad 2
+.section .ctors, "w"
+ .quad 1
+.section .ctors.00100, "w"
+ .quad 3
+
+.section .dtors, "w"
+ .quad 1
+.section .dtors.00100, "w"
+ .quad 3
+.section .dtors.00005, "w"
+ .quad 2
+
+# CHECK: Contents of section .ctors:
+# CHECK-NEXT: 140001000 01000000 00000000 02000000 00000000
+# CHECK-NEXT: 140001010 03000000 00000000
+
+# CHECK: Contents of section .dtors:
+# CHECK-NEXT: 140002000 01000000 00000000 02000000 00000000
+# CHECK-NEXT: 140002010 03000000 00000000