1// RUN: %clang_cl -MD -c -o %t %s
2// RUN: %llvm_jitlink %t 2>&1 | FileCheck %s
3// CHECK: init1
4// CHECK-NEXT: init2
5// CHECK-NEXT: init3
6
7#include <stdio.h>
8
9int init1() {
10 printf(format: "init1\n");
11 return 0;
12}
13
14int init2() {
15 printf(format: "init2\n");
16 return 0;
17}
18
19int init3() {
20 printf(format: "init3\n");
21 return 0;
22}
23
24#pragma section(".CRT$XIX", long, read)
25__declspec(allocate(".CRT$XIX")) int (*i3)(void) = init3;
26
27#pragma section(".CRT$XIV", long, read)
28__declspec(allocate(".CRT$XIV")) int (*i1)(void) = init1;
29
30#pragma section(".CRT$XIW", long, read)
31__declspec(allocate(".CRT$XIW")) int (*i2)(void) = init2;
32
33int main(int argc, char *argv[]) {
34 fflush(stdout);
35 return 0;
36}
37

source code of compiler-rt/test/orc/TestCases/Windows/x86-64/priority-static-initializer-three.c