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