blob: 971feb5dc09f347e69f7033eb0c46e8c2d0f7ca5 [file] [log] [blame]
Stephen Hines2d1fdb22014-05-28 23:58:16 -07001// Check the presence of interface symbols in compiled file.
2
3// RUN: %clang_asan -O2 %s -o %t.exe
4// RUN: nm -D %t.exe | grep " T " | sed "s/.* T //" \
5// RUN: | grep "__asan_" | sed "s/___asan_/__asan_/" \
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -08006// RUN: | sed -E "s/__asan_version_mismatch_check_v[0-9]+/__asan_version_mismatch_check/" \
Stephen Hines2d1fdb22014-05-28 23:58:16 -07007// RUN: | grep -v "__asan_default_options" \
8// RUN: | grep -v "__asan_stack_" \
9// RUN: | grep -v "__asan_on_error" > %t.symbols
10// RUN: cat %p/../../../../lib/asan/asan_interface_internal.h \
Stephen Hines2d1fdb22014-05-28 23:58:16 -070011// RUN: | sed "s/\/\/.*//" | sed "s/typedef.*//" \
12// RUN: | grep -v "OPTIONAL" \
13// RUN: | grep "__asan_.*(" | sed "s/.* __asan_/__asan_/;s/(.*//" \
14// RUN: > %t.interface
15// RUN: echo __asan_report_load1 >> %t.interface
16// RUN: echo __asan_report_load2 >> %t.interface
17// RUN: echo __asan_report_load4 >> %t.interface
18// RUN: echo __asan_report_load8 >> %t.interface
19// RUN: echo __asan_report_load16 >> %t.interface
20// RUN: echo __asan_report_store1 >> %t.interface
21// RUN: echo __asan_report_store2 >> %t.interface
22// RUN: echo __asan_report_store4 >> %t.interface
23// RUN: echo __asan_report_store8 >> %t.interface
24// RUN: echo __asan_report_store16 >> %t.interface
25// RUN: echo __asan_report_load_n >> %t.interface
26// RUN: echo __asan_report_store_n >> %t.interface
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -080027// RUN: echo __asan_report_load1_noabort >> %t.interface
28// RUN: echo __asan_report_load2_noabort >> %t.interface
29// RUN: echo __asan_report_load4_noabort >> %t.interface
30// RUN: echo __asan_report_load8_noabort >> %t.interface
31// RUN: echo __asan_report_load16_noabort >> %t.interface
32// RUN: echo __asan_report_store1_noabort >> %t.interface
33// RUN: echo __asan_report_store2_noabort >> %t.interface
34// RUN: echo __asan_report_store4_noabort >> %t.interface
35// RUN: echo __asan_report_store8_noabort >> %t.interface
36// RUN: echo __asan_report_store16_noabort >> %t.interface
37// RUN: echo __asan_report_load_n_noabort >> %t.interface
38// RUN: echo __asan_report_store_n_noabort >> %t.interface
Pirama Arumuga Nainar7c915052015-04-08 08:58:29 -070039// RUN: echo __asan_report_exp_load1 >> %t.interface
40// RUN: echo __asan_report_exp_load2 >> %t.interface
41// RUN: echo __asan_report_exp_load4 >> %t.interface
42// RUN: echo __asan_report_exp_load8 >> %t.interface
43// RUN: echo __asan_report_exp_load16 >> %t.interface
44// RUN: echo __asan_report_exp_store1 >> %t.interface
45// RUN: echo __asan_report_exp_store2 >> %t.interface
46// RUN: echo __asan_report_exp_store4 >> %t.interface
47// RUN: echo __asan_report_exp_store8 >> %t.interface
48// RUN: echo __asan_report_exp_store16 >> %t.interface
49// RUN: echo __asan_report_exp_load_n >> %t.interface
50// RUN: echo __asan_report_exp_store_n >> %t.interface
Stephen Hines2d1fdb22014-05-28 23:58:16 -070051// RUN: echo __asan_get_current_fake_stack >> %t.interface
52// RUN: echo __asan_addr_is_in_fake_stack >> %t.interface
Pirama Arumuga Nainarcdce50b2015-07-01 12:26:56 -070053// RUN: echo __asan_alloca_poison >> %t.interface
54// RUN: echo __asan_allocas_unpoison >> %t.interface
Stephen Hines2d1fdb22014-05-28 23:58:16 -070055// RUN: cat %t.interface | sort -u | diff %t.symbols -
56
57// FIXME: nm -D on powerpc somewhy shows ASan interface symbols residing
58// in "initialized data section".
59// REQUIRES: x86_64-supported-target,i386-supported-target,asan-static-runtime
60
61int main() { return 0; }