1- // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-overflow-pattern-exclusion=all -S -o - %s | FileCheck %s
2- // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-overflow-pattern-exclusion=all -fwrapv -S -o - %s | FileCheck %s
3- // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-overflow-pattern-exclusion=add-overflow-test -S -o - %s | FileCheck %s --check-prefix=ADD
4- // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-overflow-pattern-exclusion=negated-unsigned-const -S -o - %s | FileCheck %s --check-prefix=NEGATE
5- // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-overflow-pattern-exclusion=post-decr-while -S -o - %s | FileCheck %s --check-prefix=WHILE
1+ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-overflow-pattern-exclusion=all -emit-llvm -o - %s | FileCheck %s
2+ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-overflow-pattern-exclusion=all -fwrapv -emit-llvm -o - %s | FileCheck %s
3+ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-overflow-pattern-exclusion=add-overflow-test -emit-llvm -o - %s | FileCheck %s --check-prefix=ADD
4+ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-overflow-pattern-exclusion=negated-unsigned-const -emit-llvm -o - %s | FileCheck %s --check-prefix=NEGATE
5+ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-overflow-pattern-exclusion=post-decr-while -emit-llvm -o - %s | FileCheck %s --check-prefix=WHILE
66
77// Ensure some common overflow-dependent or overflow-prone code patterns don't
88// trigger the overflow sanitizers. In many cases, overflow warnings caused by
3232// NEGATE: usub.with.overflow
3333// NEGATE-NOT: negate_overflow
3434
35+ // WHILE-LABEL: @basic_commutativity
3536// WHILE: handler.add_overflow
3637// WHILE: negate_overflow
3738// WHILE-NOT: usub.with.overflow
@@ -57,6 +58,7 @@ void basic_commutativity(void) {
5758 c = 9 ;
5859}
5960
61+ // WHILE-LABEL: @arguments_and_commutativity
6062void arguments_and_commutativity (unsigned V1 , unsigned V2 ) {
6163 if (V1 + V2 < V1 )
6264 c = 9 ;
0 commit comments