[PATCH] D26560: Add a test for vcall on a null ptr.
Peter Collingbourne via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 17 17:43:05 PST 2016
pcc added inline comments.
================
Comment at: test/ubsan/TestCases/TypeCheck/null.cpp:1
-// RUN: %clangxx -fsanitize=null %s -O3 -o %t
-// RUN: %run %t l 2>&1 | FileCheck %s --check-prefix=CHECK-LOAD
-// RUN: %expect_crash %run %t s 2>&1 | FileCheck %s --check-prefix=CHECK-STORE
-// RUN: %run %t r 2>&1 | FileCheck %s --check-prefix=CHECK-REFERENCE
-// RUN: %run %t m 2>&1 | FileCheck %s --check-prefix=CHECK-MEMBER
-// RUN: %run %t f 2>&1 | FileCheck %s --check-prefix=CHECK-MEMFUN
+// RUN: %clangxx -fsanitize=null -fno-sanitize-recover=null -g %s -O3 -o %t
+// RUN: not %run %t l 2>&1 | FileCheck %s --check-prefix=CHECK-LOAD
----------------
Why add the -g?
================
Comment at: test/ubsan/TestCases/TypeCheck/null.cpp:10
+
+#include <stdio.h>
----------------
Is this #include needed?
================
Comment at: test/ubsan/TestCases/TypeCheck/null.cpp:35
+
+ if (argv[1][0] == 'T') {
+ t = new T;
----------------
Did you intend to add tests for these cases?
https://reviews.llvm.org/D26560
More information about the cfe-commits
mailing list