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
16 .type destructor,@function
21 add x0, x0, :lo12:.L.str.2
31 add x0, x0, :lo12:.L.str
38 .type constructor.65535,@function
43 add x0, x0, :lo12:.L.str.65535
45 adrp x0, .Ldestructor$local
46 add x0, x0, :lo12:.Ldestructor$local
48 add x2, x2, :lo12:__dso_handle
54 .type constructor.100,@function
59 add x0, x0, :lo12:.L.str.100
65 .type constructor.200,@function
70 add x0, x0, :lo12:.L.str.200
77 .section .rodata.str1.1,"aMS",@progbits,1
82 .type .L.str.100,@object
84 .asciz "constructor 100"
87 .type .L.str.200,@object
89 .asciz "constructor 200"
92 .type .L.str.65535,@object
94 .asciz "constructor 65535"
95 .size .L.str.65535, 18
98 .type .L.str.2,@object
103 .section .init_array.100,"aw",@init_array
105 .xword constructor.100
106 .section .init_array.200,"aw",@init_array
108 .xword constructor.200
109 .section .init_array,"aw",@init_array
111 .xword constructor.65535