1// RUN: %clangxx -fsanitize=builtin -g0 %s -o %t
2
3// Suppression by symbol name requires the compiler-rt runtime to be able to
4// symbolize stack addresses.
5// REQUIRES: can-symbolize
6// UNSUPPORTED: android
7
8// RUN: echo "invalid-builtin-use:do_ctz" > %t.func-supp
9// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.func-supp"' %run %t
10
11#include <stdint.h>
12
13extern "C" void do_ctz(int n) { __builtin_ctz(0); }
14
15int main() {
16 do_ctz(n: 0);
17 return 0;
18}
19

source code of compiler-rt/test/ubsan/TestCases/Integer/suppressions-builtin.cpp