File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
1
// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s --check-prefix=DEFAULT
2
2
// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -fwrapv | FileCheck %s --check-prefix=WRAPV
3
3
// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -ftrapv | FileCheck %s --check-prefix=TRAPV
4
- // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -fsanitize=signed-integer-overflow | FileCheck %s --check-prefixes=CATCH_UB
5
- // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -fsanitize=signed-integer-overflow -fwrapv | FileCheck %s --check-prefixes=CATCH_UB
4
+ // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -fsanitize=signed-integer-overflow | FileCheck %s --check-prefixes=CATCH_UB,NOCATCH_UB_POINTER
5
+ // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -fsanitize=signed-integer-overflow -fwrapv | FileCheck %s --check-prefixes=CATCH_UB,NOCATCH_UB_POINTER
6
6
// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -ftrapv -ftrapv-handler foo | FileCheck %s --check-prefix=TRAPV_HANDLER
7
7
8
8
@@ -57,6 +57,15 @@ void test1(void) {
57
57
// TRAPV_HANDLER: foo(
58
58
-- a ;
59
59
60
+ // -fwrapv does not affect inbounds for GEP's.
61
+ // This is controlled by -fwrapv-pointer instead.
62
+ extern int * P ;
63
+ ++ P ;
64
+ // DEFAULT: getelementptr inbounds nuw i32, ptr
65
+ // WRAPV: getelementptr inbounds nuw i32, ptr
66
+ // TRAPV: getelementptr inbounds nuw i32, ptr
67
+ // NOCATCH_UB_POINTER: getelementptr inbounds nuw i32, ptr
68
+
60
69
// PR9350: char pre-increment never overflows.
61
70
extern volatile signed char PR9350_char_inc ;
62
71
// DEFAULT: add i8 {{.*}}, 1
You can’t perform that action at this time.
0 commit comments