blob: d325bf6dd8997942658713e3ec1d858cadb8d359 [file] [log] [blame]
Peter Collingbourne49d29ed2013-10-20 21:29:32 +00001// RUN: %clangxx -fsanitize=undefined %s -o %t && %t 2>&1 | FileCheck %s
Will Dietz2af552f2013-01-09 03:40:03 +00002// Verify deduplication works by ensuring only one diag is emitted.
3#include <limits.h>
4#include <stdio.h>
5
6void overflow() {
7 int i = INT_MIN;
8 --i;
9}
10
11int main() {
12 // CHECK: Start
13 fprintf(stderr, "Start\n");
14
15 // CHECK: runtime error
16 // CHECK-NOT: runtime error
17 // CHECK-NOT: runtime error
18 overflow();
19 overflow();
20 overflow();
21
22 // CHECK: End
23 fprintf(stderr, "End\n");
24 return 0;
25}