1 ; Test that global constructors are correctly ordered
3 ; RUN: lli -jit-kind=orc %s | FileCheck %s
29 declare i32 @puts(ptr)
31 @str.H1 = private constant [3 x i8] c"H1\00"
32 @str.H2 = private constant [3 x i8] c"H2\00"
33 @str.H3 = private constant [3 x i8] c"H3\00"
34 @str.M1 = private constant [3 x i8] c"M1\00"
35 @str.M2 = private constant [3 x i8] c"M2\00"
36 @str.M3 = private constant [3 x i8] c"M3\00"
37 @str.1 = private constant [2 x i8] c"1\00"
38 @str.2 = private constant [2 x i8] c"2\00"
39 @str.3 = private constant [2 x i8] c"3\00"
40 @str.4 = private constant [2 x i8] c"4\00"
41 @str.5 = private constant [2 x i8] c"5\00"
42 @str.6 = private constant [2 x i8] c"6\00"
43 @str.7 = private constant [2 x i8] c"7\00"
44 @str.8 = private constant [2 x i8] c"8\00"
45 @str.9 = private constant [2 x i8] c"9\00"
46 @str.10 = private constant [3 x i8] c"10\00"
47 @str.11 = private constant [3 x i8] c"11\00"
48 @str.12 = private constant [3 x i8] c"12\00"
49 @str.13 = private constant [3 x i8] c"13\00"
50 @str.14 = private constant [3 x i8] c"14\00"
51 @str.15 = private constant [3 x i8] c"15\00"
52 @str.16 = private constant [3 x i8] c"16\00"
53 @str.17 = private constant [3 x i8] c"17\00"
54 @llvm.global_ctors = appending global [23 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 1024, ptr @medium.1, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @default.1, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @default.2, ptr null }, { i32, ptr, ptr } { i32 1, ptr @high.1, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @default.3, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @default.4, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @default.5, ptr null }, { i32, ptr, ptr } { i32 1, ptr @high.2, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @default.6, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @default.7, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @default.8, ptr null }, { i32, ptr, ptr } { i32 1024, ptr @medium.2, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @default.9, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @default.10, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @default.11, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @default.12, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @default.13, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @default.14, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @default.15, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @default.16, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @default.17, ptr null }, { i32, ptr, ptr } { i32 1024, ptr @medium.3, ptr null }, { i32, ptr, ptr } { i32 1, ptr @high.3, ptr null }]
56 define internal i32 @high.1() #0 {
57 %call = tail call i32 @puts(ptr @str.H1)
61 define internal i32 @high.2() #0 {
62 %call = tail call i32 @puts(ptr @str.H2)
66 define internal i32 @high.3() #0 {
67 %call = tail call i32 @puts(ptr @str.H3)
71 define internal i32 @medium.1() #0 {
72 %call = tail call i32 @puts(ptr @str.M1)
76 define internal i32 @medium.2() #0 {
77 %call = tail call i32 @puts(ptr @str.M2)
81 define internal i32 @medium.3() #0 {
82 %call = tail call i32 @puts(ptr @str.M3)
86 define internal i32 @default.1() #0 {
87 %call = tail call i32 @puts(ptr @str.1)
91 define internal i32 @default.2() #0 {
92 %call = tail call i32 @puts(ptr @str.2)
96 define internal i32 @default.3() #0 {
97 %call = tail call i32 @puts(ptr @str.3)
101 define internal i32 @default.4() #0 {
102 %call = tail call i32 @puts(ptr @str.4)
106 define internal i32 @default.5() #0 {
107 %call = tail call i32 @puts(ptr @str.5)
111 define internal i32 @default.6() #0 {
112 %call = tail call i32 @puts(ptr @str.6)
116 define internal i32 @default.7() #0 {
117 %call = tail call i32 @puts(ptr @str.7)
121 define internal i32 @default.8() #0 {
122 %call = tail call i32 @puts(ptr @str.8)
126 define internal i32 @default.9() #0 {
127 %call = tail call i32 @puts(ptr @str.9)
131 define internal i32 @default.10() #0 {
132 %call = tail call i32 @puts(ptr @str.10)
136 define internal i32 @default.11() #0 {
137 %call = tail call i32 @puts(ptr @str.11)
141 define internal i32 @default.12() #0 {
142 %call = tail call i32 @puts(ptr @str.12)
146 define internal i32 @default.13() #0 {
147 %call = tail call i32 @puts(ptr @str.13)
151 define internal i32 @default.14() #0 {
152 %call = tail call i32 @puts(ptr @str.14)
156 define internal i32 @default.15() #0 {
157 %call = tail call i32 @puts(ptr @str.15)
161 define internal i32 @default.16() #0 {
162 %call = tail call i32 @puts(ptr @str.16)
166 define internal i32 @default.17() #0 {
167 %call = tail call i32 @puts(ptr @str.17)