Skip to content

Commit da97931

Browse files
committed
restore test
1 parent 925f74c commit da97931

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

clang/test/CodeGen/integer-overflow.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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

0 commit comments

Comments
 (0)