[compiler-rt] r304440 - Tighten up test to address bot failure. NFC.
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 1 10:56:12 PDT 2017
Author: vedantk
Date: Thu Jun 1 12:56:12 2017
New Revision: 304440
URL: http://llvm.org/viewvc/llvm-project?rev=304440&view=rev
Log:
Tighten up test to address bot failure. NFC.
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/32035
Modified:
compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/PR33221.cpp
Modified: compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/PR33221.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/PR33221.cpp?rev=304440&r1=304439&r2=304440&view=diff
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/PR33221.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/PR33221.cpp Thu Jun 1 12:56:12 2017
@@ -1,8 +1,10 @@
-// RUN: %clangxx -frtti -fsanitize=undefined -g %s -O3 -o %t
+// RUN: %clangxx -frtti -fsanitize=vptr -g %s -O3 -o %t
// RUN: %run %t 2>&1 | FileCheck %s
// REQUIRES: cxxabi
+#include <string.h>
+
class Base {
public:
int i;
@@ -15,10 +17,12 @@ public:
};
int main() {
- Derived *list = (Derived *)new char[sizeof(Derived)];
+ char *c = new char[sizeof(Derived)];
+ memset((void *)c, 0, sizeof(Derived));
+ Derived *list = (Derived *)c;
// CHECK: PR33221.cpp:[[@LINE+2]]:19: runtime error: member access within address {{.*}} which does not point to an object of type 'Base'
-// CHECK-NEXT: object has invalid vptr
+// CHECK-NEXT: invalid vptr
int foo = list->i;
return 0;
}
More information about the llvm-commits
mailing list