1 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-undefined-ignore-overflow-pattern=all %s -emit-llvm -o - | FileCheck %s
2 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-undefined-ignore-overflow-pattern=all -fwrapv %s -emit-llvm -o - | FileCheck %s
4 // Check for potential false positives from patterns that _almost_ match classic overflow-dependent or overflow-prone code patterns
5 extern unsigned a
, b
, c
;
7 extern unsigned some(void);
9 // Make sure all these still have handler paths, we shouldn't be excluding
10 // instrumentation of any "near" patterns.
11 // CHECK-LABEL: close_but_not_quite
12 void close_but_not_quite(void) {
13 // CHECK: br i1{{.*}}handler.
17 // CHECK: br i1{{.*}}handler.
21 // CHECK: br i1{{.*}}handler.
25 // CHECK: br i1{{.*}}handler.
29 // CHECK: br i1{{.*}}handler.
30 // CHECK: br i1{{.*}}handler.
34 // CHECK: br i1{{.*}}handler.
38 // CHECK: br i1{{.*}}handler.
42 // CHECK: br i1{{.*}}handler.
46 // CHECK: br i1{{.*}}handler
51 // CHECK-LABEL: function_calls
52 void function_calls(void) {
53 // CHECK: br i1{{.*}}handler
54 if (some() + b
< some())
58 // CHECK-LABEL: not_quite_a_negated_unsigned_const
59 void not_quite_a_negated_unsigned_const(void) {
60 // CHECK: br i1{{.*}}handler