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 11// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s --check-prefix=DEFAULT
22// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -fwrapv | FileCheck %s --check-prefix=WRAPV
33// 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
66// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -ftrapv -ftrapv-handler foo | FileCheck %s --check-prefix=TRAPV_HANDLER
77
88
@@ -57,6 +57,15 @@ void test1(void) {
5757 // TRAPV_HANDLER: foo(
5858 -- a ;
5959
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+
6069 // PR9350: char pre-increment never overflows.
6170 extern volatile signed char PR9350_char_inc ;
6271 // DEFAULT: add i8 {{.*}}, 1
You can’t perform that action at this time.
0 commit comments