File: interface_symbols_windows.cpp

package info (click to toggle)
llvm-toolchain-18 1%3A18.1.8-18
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 1,908,340 kB
  • sloc: cpp: 6,667,937; ansic: 1,440,452; asm: 883,619; python: 230,549; objc: 76,880; f90: 74,238; lisp: 35,989; pascal: 16,571; sh: 10,229; perl: 7,459; ml: 5,047; awk: 3,523; makefile: 2,987; javascript: 2,149; xml: 892; fortran: 649; cs: 573
file content (56 lines) | stat: -rw-r--r-- 2,805 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// UNSUPPORTED: target={{.*-windows-gnu}}

// Check that the interface exported by asan static lib matches the list of
// functions mentioned in sanitizer_interface.inc.
//
// Just make sure we can compile this.
// RUN: %clang_cl_asan -Od %s -Fe%t
//
// note: The mangling decoration (i.e. @4 )is removed because calling convention
//       differ from 32-bit and 64-bit.
//
// RUN: dumpbin /EXPORTS %t | sed "s/=.*//"                                    \
// RUN:   | grep -o "\(__asan_\|__ubsan_\|__sanitizer_\|__sancov_\)[^ ]*"      \
// RUN:   | grep -v "__asan_wrap"                                              \
// RUN:   | sed -e s/@.*// > %t.exports
//
// [BEWARE: be really careful with the sed commands, as this test can be run
//  from different environments with different shells and seds]
//
// RUN: sed ':a;N;$!ba;s/([\n ]*/(/g'                                          \
// RUN:  %p/../../../../lib/asan/asan_interface.inc                            \
// RUN:  %p/../../../../lib/ubsan/ubsan_interface.inc                          \
// RUN:  %p/../../../../lib/sanitizer_common/sanitizer_common_interface.inc    \
// RUN:  %p/../../../../lib/sanitizer_common/sanitizer_coverage_interface.inc  \
// RUN:  | grep -e "^INTERFACE_FUNCTION"                                       \
// RUN:  | sed -e "s/.*(//" -e "s/).*//" > %t.imports1
//
// RUN: sed ':a;N;$!ba;s/([\n ]*/(/g'                                          \
// RUN:  %p/../../../../lib/asan/asan_interface.inc                            \
// RUN:  %p/../../../../lib/ubsan/ubsan_interface.inc                          \
// RUN:  %p/../../../../lib/sanitizer_common/sanitizer_common_interface.inc    \
// RUN:  %p/../../../../lib/sanitizer_common/sanitizer_coverage_interface.inc  \
// RUN:  | grep -e "^INTERFACE_WEAK_FUNCTION"                                  \
// RUN:  | sed -e "s/.*(//" -e "s/).*/__dll/" > %t.imports2
//
// Add functions not included in the interface lists:
// RUN: grep '[I]MPORT:' %s | sed -e 's/.*[I]MPORT: //' > %t.imports3
// IMPORT: __asan_shadow_memory_dynamic_address
// IMPORT: __asan_get_shadow_memory_dynamic_address
// IMPORT: __asan_option_detect_stack_use_after_return
// IMPORT: __asan_should_detect_stack_use_after_return
// IMPORT: __asan_set_seh_filter
// IMPORT: __asan_unhandled_exception_filter
// IMPORT: __asan_test_only_reported_buggy_pointer
// IMPORT: __ubsan_vptr_type_cache
//
// RUN: cat %t.imports1 %t.imports2 %t.imports3 | sort | uniq > %t.imports-sorted
// RUN: cat %t.exports | sort | uniq > %t.exports-sorted
//
// Now make sure the DLL thunk imports everything:
// RUN: echo
// RUN: echo "=== NOTE === If you see a mismatch below, please update interface.inc files."
// RUN: diff %t.imports-sorted %t.exports-sorted
// REQUIRES: asan-static-runtime

int main() { return 0; }