[ASan/Win] Use clang rather than clang-cl by default for lit tests. Make Windows...
[blocksruntime.git] / test / msan / wrap_indirect_calls.cc
blobbe17bd824ecfe3f90b639175e632e45532ceb905
1 // Test indirect call wrapping in MemorySanitizer.
3 // RUN: %clangxx_msan -O0 %p/wrap_indirect_calls/two.cc -fPIC -shared -o %t-two-so.so
4 // RUN: %clangxx_msan -O0 %p/wrap_indirect_calls/wrapper.cc -fPIC -shared -o %t-wrapper-so.so
6 // Disable fast path.
8 // RUN: %clangxx_msan -O0 %p/wrap_indirect_calls/caller.cc %p/wrap_indirect_calls/one.cc %s \
9 // RUN: %t-two-so.so %t-wrapper-so.so \
10 // RUN: -mllvm -msan-wrap-indirect-calls=wrapper \
11 // RUN: -mllvm -msan-wrap-indirect-calls-fast=0 \
12 // RUN: -DSLOW=1 \
13 // RUN: -Wl,--defsym=__executable_start=0 -o %t
14 // RUN: %run %t
16 // Enable fast path, call from executable, -O0.
18 // RUN: %clangxx_msan -O0 %p/wrap_indirect_calls/caller.cc %p/wrap_indirect_calls/one.cc %s \
19 // RUN: %t-two-so.so %t-wrapper-so.so \
20 // RUN: -mllvm -msan-wrap-indirect-calls=wrapper \
21 // RUN: -mllvm -msan-wrap-indirect-calls-fast=1 \
22 // RUN: -DSLOW=0 \
23 // RUN: -Wl,--defsym=__executable_start=0 -o %t
24 // RUN: %run %t
26 // Enable fast path, call from executable, -O3.
28 // RUN: %clangxx_msan -O3 %p/wrap_indirect_calls/caller.cc %p/wrap_indirect_calls/one.cc %s \
29 // RUN: %t-two-so.so %t-wrapper-so.so \
30 // RUN: -mllvm -msan-wrap-indirect-calls=wrapper \
31 // RUN: -mllvm -msan-wrap-indirect-calls-fast=1 \
32 // RUN: -DSLOW=0 \
33 // RUN: -Wl,--defsym=__executable_start=0 -o %t
34 // RUN: %run %t
36 // Enable fast path, call from DSO, -O0.
38 // RUN: %clangxx_msan -O0 %p/wrap_indirect_calls/caller.cc %p/wrap_indirect_calls/one.cc -shared \
39 // RUN: %t-two-so.so %t-wrapper-so.so \
40 // RUN: -mllvm -msan-wrap-indirect-calls=wrapper \
41 // RUN: -mllvm -msan-wrap-indirect-calls-fast=1 \
42 // RUN: -DSLOW=0 \
43 // RUN: -Wl,--defsym=__executable_start=0 -o %t-caller-so.so
44 // RUN: %clangxx_msan -O0 %s %t-caller-so.so %t-two-so.so %t-wrapper-so.so -o %t
45 // RUN: %run %t
47 // Enable fast path, call from DSO, -O3.
49 // RUN: %clangxx_msan -O3 %p/wrap_indirect_calls/caller.cc %p/wrap_indirect_calls/one.cc -shared \
50 // RUN: %t-two-so.so %t-wrapper-so.so \
51 // RUN: -mllvm -msan-wrap-indirect-calls=wrapper \
52 // RUN: -mllvm -msan-wrap-indirect-calls-fast=1 \
53 // RUN: -DSLOW=0 \
54 // RUN: -Wl,--defsym=__executable_start=0 -o %t-caller-so.so
55 // RUN: %clangxx_msan -O3 %s %t-caller-so.so %t-two-so.so %t-wrapper-so.so -o %t
56 // RUN: %run %t
58 // The actual test is in multiple files in wrap_indirect_calls/ directory.
59 void run_test();
61 int main() {
62 run_test();
63 return 0;