]> git.proxmox.com Git - rustc.git/blame - src/compiler-rt/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc
New upstream version 1.19.0+dfsg1
[rustc.git] / src / compiler-rt / test / sanitizer_common / TestCases / Posix / dedup_token_length_test.cc
CommitLineData
5bcae85e
SL
1// Test dedup_token_length
2// RUN: %clangxx -O0 %s -o %t
7cac9316
XL
3// RUN: env %tool_options='abort_on_error=0' not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0 --match-full-lines
4// RUN: env %tool_options='abort_on_error=0, dedup_token_length=0' not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0 --match-full-lines
5// RUN: env %tool_options='abort_on_error=0, dedup_token_length=1' not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 --match-full-lines
6// RUN: env %tool_options='abort_on_error=0, dedup_token_length=2' not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK2 --match-full-lines
7// RUN: env %tool_options='abort_on_error=0, dedup_token_length=3' not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --match-full-lines
5bcae85e
SL
8
9// REQUIRES: stable-runtime
10// FIXME: implement SEGV handler in other sanitizers, not just asan.
11// XFAIL: msan
12// XFAIL: lsan
13// XFAIL: tsan
14
15volatile int *null = 0;
16
17namespace Xyz {
18 template<class A, class B> void Abc() {
19 *null = 0;
20 }
21}
22
23extern "C" void bar() {
24 Xyz::Abc<int, int>();
25}
26
27void FOO() {
28 bar();
29}
30
31int main(int argc, char **argv) {
32 FOO();
33}
34
35// CHECK0-NOT: DEDUP_TOKEN:
36// CHECK1: DEDUP_TOKEN: void Xyz::Abc<int, int>()
5bcae85e 37// CHECK2: DEDUP_TOKEN: void Xyz::Abc<int, int>()--bar
5bcae85e 38// CHECK3: DEDUP_TOKEN: void Xyz::Abc<int, int>()--bar--FOO()