1// UNSUPPORTED: ios, android
2// Check plugin command line args get parsed and that plugin functions get called as expected.
3
4// RUN: %clangxx_asan -O0 -g %s -o %t.executable
5// RUN: not %env_asan_opts=symbolize=0 %run %t.executable > %t.log 2>&1
6// RUN: %asan_symbolize --plugins %S/plugin_no_op.py --log-level info -l %t.log --unlikely-option-name-XXX=15 2>&1 | FileCheck %s
7
8// CHECK: GOT --unlikely-option-name-XXX=15
9// CHECK: filter_binary_path called in NoOpPlugin
10// CHECK: destroy() called on NoOpPlugin
11
12#include <cstdlib>
13extern "C" void foo(int* a) {
14 *a = 5;
15}
16
17int main() {
18 int* a = (int*) malloc(size: sizeof(int));
19 if (!a)
20 return 0;
21 free(ptr: a);
22 foo(a);
23 return 0;
24}
25

source code of compiler-rt/test/asan/TestCases/Posix/asan_symbolize_script/plugin_no_op_symbolicate.cpp