Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / Interpreter / dynamic-library.cpp
blob6c4621f729c1c888f7ab15bac78c3ba2c7980a5e
1 // REQUIRES: host-supports-jit, x86_64-linux
3 // To generate libdynamic-library-test.so :
4 // clang -xc++ -o libdynamic-library-test.so -fPIC -shared
5 //
6 // extern "C" {
7 //
8 // int ultimate_answer = 0;
9 //
10 // int calculate_answer() {
11 // ultimate_answer = 42;
12 // return 5;
13 // }
15 // }
17 // RUN: cat %s | env LD_LIBRARY_PATH=%S/Inputs:$LD_LIBRARY_PATH clang-repl | FileCheck %s
19 extern "C" int printf(const char* format, ...);
21 extern "C" int ultimate_answer;
22 extern "C" int calculate_answer();
24 %lib libdynamic-library-test.so
26 printf("Return value: %d\n", calculate_answer());
27 // CHECK: Return value: 5
29 printf("Variable: %d\n", ultimate_answer);
30 // CHECK-NEXT: Variable: 42
32 %quit