Home | History | Annotate | Download | only in Misc
      1 // RUN: %clang -fsanitize=undefined %s -o %t && %t 2>&1 | FileCheck %s
      2 // Verify deduplication works by ensuring only one diag is emitted.
      3 #include <limits.h>
      4 #include <stdio.h>
      5 
      6 void overflow() {
      7   int i = INT_MIN;
      8   --i;
      9 }
     10 
     11 int 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 }
     26