1 // Test that ELF static initializers with different constructor priorities work
2 // and are executed in the proper order.
4 // RUN: %clang -c -o %t %s
5 // RUN: %llvm_jitlink %t | FileCheck %s
7 // CHECK: constructor 100
8 // CHECK-NEXT: constructor 200
9 // CHECK-NEXT: constructor 65535
11 // CHECK-NEXT: destructor
17 .type destructor,@function
21 leaq .L.str.d(%rip), %rdi
31 leaq .L.str(%rip), %rdi
38 .type constructor.65535,@function
42 leaq .L.str.65535(%rip), %rdi
44 leaq .Ldestructor$local(%rip), %rdi
45 leaq __dso_handle(%rip), %rdx
51 .type constructor.200,@function
54 leaq .L.str.200(%rip), %rdi
58 .type constructor.100,@function
61 leaq .L.str.100(%rip), %rdi
66 .section .rodata.str1.1,"aMS",@progbits,1
71 .type .L.str.100,@object
73 .asciz "constructor 100"
76 .type .L.str.200,@object
78 .asciz "constructor 200"
81 .type .L.str.65535,@object
83 .asciz "constructor 65535"
84 .size .L.str.65535, 18
86 .type .L.str.d,@object
91 .section .init_array.100,"aw",@init_array
94 .section .init_array.200,"aw",@init_array
97 .section .init_array,"aw",@init_array
99 .quad constructor.65535