27 lines · cpp
1// RUN: %clangxx -fsanitize=undefined %s -o %t && %run %t 2>&1 | FileCheck %s2// 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: Start13 fprintf(stderr, "Start\n");14 fflush(stderr);15 16 // CHECK: runtime error17 // CHECK-NOT: runtime error18 // CHECK-NOT: runtime error19 overflow();20 overflow();21 overflow();22 23 // CHECK: End24 fprintf(stderr, "End\n");25 return 0;26}27