Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit 335962e

Browse files
committed
[UBSan] Revisit nullptr-and-nonzero-offset-variable.cpp test to hopefully make it pass on sanitizer-windows BB
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@374298 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent a8681c5 commit 335962e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/ubsan/TestCases/Pointer/nullptr-and-nonzero-offset-variable.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// R1UN: %clang -x c -fsanitize=pointer-overflow -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="error:" --check-prefix=CHECK-UB-C
2-
// R1UN: %clang -x c -fsanitize=pointer-overflow -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="error:" --check-prefix=CHECK-UB-C
3-
// R1UN: %clang -x c -fsanitize=pointer-overflow -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="error:" --check-prefix=CHECK-UB-C
4-
// R1UN: %clang -x c -fsanitize=pointer-overflow -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="error:" --check-prefix=CHECK-UB-C
1+
// RUN: %clang -x c -fsanitize=pointer-overflow -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="error:" --check-prefix=CHECK-UB-C
2+
// RUN: %clang -x c -fsanitize=pointer-overflow -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="error:" --check-prefix=CHECK-UB-C
3+
// RUN: %clang -x c -fsanitize=pointer-overflow -O2 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="error:" --check-prefix=CHECK-UB-C
4+
// RUN: %clang -x c -fsanitize=pointer-overflow -O3 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="error:" --check-prefix=CHECK-UB-C
55

66
// RUN: %clang -x c++ -fsanitize=pointer-overflow -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="error:" --check-prefix=CHECK
77
// RUN: %clang -x c++ -fsanitize=pointer-overflow -O1 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="error:" --check-prefix=CHECK
@@ -42,13 +42,13 @@ int main(int argc, char *argv[]) {
4242
offset = argc - 1;
4343
(void)getelementpointer_inbounds_v0(base, offset);
4444
// CHECK-UB: {{.*}}.cpp:[[@LINE-17]]:15: runtime error: applying non-zero offset 1 to null pointer
45-
// CHECK-UB-C: {{.*}}.cpp:[[@LINE-17]]:15: runtime error: applying offset to null pointer
45+
// CHECK-UB-C: {{.*}}.cpp:[[@LINE-18]]:15: runtime error: applying zero offset to null pointer
4646

4747
base = (char *)(intptr_t)(argc - 1);
4848
offset = argc == 1 ? 0 : -(argc - 1);
4949
(void)getelementpointer_inbounds_v1(base, offset);
50-
// CHECK-UB: {{.*}}.cpp:[[@LINE-19]]:15: runtime error: applying non-zero offset to non-null pointer 0x{{.*}} produced null pointer
51-
// CHECK-UB-C: {{.*}}.cpp:[[@LINE-20]]:15: runtime error: applying offset to null pointer
50+
// CHECK-UB: {{.*}}.cpp:[[@LINE-19]]:15: runtime error: applying non-zero offset to non-null pointer {{.*}} produced null pointer
51+
// CHECK-UB-C: {{.*}}.cpp:[[@LINE-20]]:15: runtime error: applying zero offset to null pointer
5252

5353
return 0;
5454
}

0 commit comments

Comments
 (0)