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 init1()8int init1() { 9 printf("init1\n"); 10 return 0; 11 } 12 init2()13int init2() { 14 printf("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 main(int argc,char * argv[])24int main(int argc, char *argv[]) { 25 fflush(stdout); 26 return 0; 27 } 28