1 | // Check that the -all_load flag to llvm-jitlink causes all objects from |
2 | // archives to be loaded, regardless of whether or not they're referenced. |
3 | // |
4 | // RUN: rm -rf %t && mkdir -p %t |
5 | // RUN: %clangxx -c -o %t/SetX.o %S/Inputs/SetGlobalIntXInConstructor.cpp |
6 | // RUN: ar r %t/libSetX.a %t/SetX.o |
7 | // RUN: %clang -c -o %t/all_load.o %s |
8 | // RUN: %llvm_jitlink -all_load %t/all_load.o -L%t -lSetX |
9 | // |
10 | // REQUIRES: system-darwin && host-arch-compatible |
11 | |
12 | int x = 0; |
13 | |
14 | int main(int argc, char *argv[]) { return x == 1 ? 0 : 1; } |
15 | |