[compiler-rt] r374298 - [UBSan] Revisit nullptr-and-nonzero-offset-variable.cpp test to hopefully make it pass on sanitizer-windows BB
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 10 02:51:13 PDT 2019
Author: lebedevri
Date: Thu Oct 10 02:51:13 2019
New Revision: 374298
URL: http://llvm.org/viewvc/llvm-project?rev=374298&view=rev
Log:
[UBSan] Revisit nullptr-and-nonzero-offset-variable.cpp test to hopefully make it pass on sanitizer-windows BB
Modified:
compiler-rt/trunk/test/ubsan/TestCases/Pointer/nullptr-and-nonzero-offset-variable.cpp
Modified: compiler-rt/trunk/test/ubsan/TestCases/Pointer/nullptr-and-nonzero-offset-variable.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/Pointer/nullptr-and-nonzero-offset-variable.cpp?rev=374298&r1=374297&r2=374298&view=diff
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/Pointer/nullptr-and-nonzero-offset-variable.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/Pointer/nullptr-and-nonzero-offset-variable.cpp Thu Oct 10 02:51:13 2019
@@ -1,7 +1,7 @@
-// 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
-// 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
-// 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
-// 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
+// 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
+// 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
+// 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
+// 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
// RUN: %clang -x c++ -fsanitize=pointer-overflow -O0 %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="error:" --check-prefix=CHECK
// 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[]) {
offset = argc - 1;
(void)getelementpointer_inbounds_v0(base, offset);
// CHECK-UB: {{.*}}.cpp:[[@LINE-17]]:15: runtime error: applying non-zero offset 1 to null pointer
- // CHECK-UB-C: {{.*}}.cpp:[[@LINE-17]]:15: runtime error: applying offset to null pointer
+ // CHECK-UB-C: {{.*}}.cpp:[[@LINE-18]]:15: runtime error: applying zero offset to null pointer
base = (char *)(intptr_t)(argc - 1);
offset = argc == 1 ? 0 : -(argc - 1);
(void)getelementpointer_inbounds_v1(base, offset);
- // CHECK-UB: {{.*}}.cpp:[[@LINE-19]]:15: runtime error: applying non-zero offset to non-null pointer 0x{{.*}} produced null pointer
- // CHECK-UB-C: {{.*}}.cpp:[[@LINE-20]]:15: runtime error: applying offset to null pointer
+ // CHECK-UB: {{.*}}.cpp:[[@LINE-19]]:15: runtime error: applying non-zero offset to non-null pointer {{.*}} produced null pointer
+ // CHECK-UB-C: {{.*}}.cpp:[[@LINE-20]]:15: runtime error: applying zero offset to null pointer
return 0;
}
More information about the llvm-commits
mailing list