Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / Posix / dedup_token_length_test.cpp
blobdeedbba76cdeb194606b3b2b2c2da56b5547d870
1 // Test dedup_token_length
2 // Fails with debug checks: https://bugs.llvm.org/show_bug.cgi?id=46860
3 // XFAIL: !compiler-rt-optimized && tsan
4 // RUN: %clangxx -O0 %s -o %t
5 // RUN: env %tool_options='abort_on_error=0' not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0 --match-full-lines
6 // 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
7 // 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
8 // 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
9 // 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
11 // REQUIRES: stable-runtime
13 // XFAIL: target={{.*netbsd.*}} && !asan
15 volatile int *null = 0;
17 namespace Xyz {
18 template<class A, class B> void Abc() {
19 *null = 0;
23 extern "C" void bar() {
24 Xyz::Abc<int, int>();
27 void FOO() {
28 bar();
31 int main(int argc, char **argv) {
32 FOO();
35 // CHECK0-NOT: DEDUP_TOKEN:
36 // CHECK1: DEDUP_TOKEN: void Xyz::Abc<int, int>()
37 // CHECK2: DEDUP_TOKEN: void Xyz::Abc<int, int>()--bar
38 // CHECK3: DEDUP_TOKEN: void Xyz::Abc<int, int>()--bar--FOO()