1 /// When -fwrapv (implied by -fno-strict-overflow) is enabled,
2 /// -fsanitize=undefined does not expand to signed-integer-overflow.
3 /// -fsanitize=signed-integer-overflow is unaffected by -fwrapv.
5 // RUN: %clang -### --target=x86_64-linux -fwrapv -fsanitize=signed-integer-overflow %s 2>&1 | FileCheck %s
6 // CHECK: -fsanitize=signed-integer-overflow
7 // CHECK: -fsanitize-recover=signed-integer-overflow
9 // RUN: %clang -### --target=x86_64-linux -fno-strict-overflow -fsanitize=undefined %s 2>&1 | FileCheck %s --check-prefix=EXCLUDE
10 // RUN: %clang -### --target=x86_64-linux -fstrict-overflow -fwrapv -fsanitize=undefined %s 2>&1 | FileCheck %s --check-prefix=EXCLUDE
11 // EXCLUDE: -fsanitize=alignment,array-bounds,
12 // EXCLUDE-NOT: signed-integer-overflow,
13 // EXCLUDE: -fsanitize-recover=alignment,array-bounds,
14 // EXCLUDE-SAME: signed-integer-overflow
16 // RUN: %clang -### --target=x86_64-linux -fwrapv -fsanitize=undefined -fsanitize=signed-integer-overflow %s 2>&1 | FileCheck %s --check-prefix=INCLUDE
17 // RUN: %clang -### --target=x86_64-linux -fno-strict-overflow -fno-sanitize=signed-integer-overflow -fsanitize=undefined -fsanitize=signed-integer-overflow %s 2>&1 | FileCheck %s --check-prefix=INCLUDE
18 // INCLUDE: -fsanitize=alignment,array-bounds,
19 // INCLUDE-SAME: signed-integer-overflow
20 // INCLUDE: -fsanitize-recover=alignment,array-bounds,
21 // INCLUDE-SAME: signed-integer-overflow
23 /// -fsanitize-trap=undefined expands to signed-integer-overflow regardless of -fwrapv.
24 // RUN: %clang -### --target=x86_64-linux -fwrapv -fsanitize=undefined -fsanitize=signed-integer-overflow -fsanitize-trap=undefined %s 2>&1 | FileCheck %s --check-prefix=INCLUDE-TRAP
25 // INCLUDE-TRAP: -fsanitize=alignment,array-bounds,
26 // INCLUDE-TRAP-SAME: signed-integer-overflow
27 // INCLUDE-TRAP: -fsanitize-trap=alignment,array-bounds,
28 // INCLUDE-TRAP-SAME: signed-integer-overflow