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
6#include <stdio.h>
7
8int init1() {
9 printf(format: "init1\n");
10 return 0;
11}
12
13int init2() {
14 printf(format: "init2\n");
15 return 0;
16}
17
18#pragma section(".CRT$XIW", long, read)
19__declspec(allocate(".CRT$XIW")) int (*i2)(void) = init2;
20
21#pragma section(".CRT$XIV", long, read)
22__declspec(allocate(".CRT$XIV")) int (*i1)(void) = init1;
23
24int main(int argc, char *argv[]) {
25 fflush(stdout);
26 return 0;
27}
28

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