Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / ubsan / TestCases / Misc / deduplication.cpp
blob4b02590fa0ac20b9ef8459b92e2ec8bdee508c0b
1 // RUN: %clangxx -fsanitize=undefined %s -o %t && %run %t 2>&1 | FileCheck %s
2 // Verify deduplication works by ensuring only one diag is emitted.
3 #include <limits.h>
4 #include <stdio.h>
6 void overflow() {
7 int i = INT_MIN;
8 --i;
11 int main() {
12 // CHECK: Start
13 fprintf(stderr, "Start\n");
14 fflush(stderr);
16 // CHECK: runtime error
17 // CHECK-NOT: runtime error
18 // CHECK-NOT: runtime error
19 overflow();
20 overflow();
21 overflow();
23 // CHECK: End
24 fprintf(stderr, "End\n");
25 return 0;