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
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 \
13 // RUN: -Wl,--defsym=__executable_start=0 -o %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 \
23 // RUN: -Wl,--defsym=__executable_start=0 -o %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 \
33 // RUN: -Wl,--defsym=__executable_start=0 -o %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 \
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
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 \
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
58 // The actual test is in multiple files in wrap_indirect_calls/ directory.