[compiler-rt] r366389 - hwasan: Use C++ driver for cfi.cc test.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 16:35:15 PDT 2019


Author: pcc
Date: Wed Jul 17 16:35:15 2019
New Revision: 366389

URL: http://llvm.org/viewvc/llvm-project?rev=366389&view=rev
Log:
hwasan: Use C++ driver for cfi.cc test.

It turns out that this test was only passing by accident. It was relying on
the optimizer to remove the only reference to A's vtable by realizing that
the CFI check will always fail. The vtable contains a reference to RTTI in
libc++, which will be unresolved because the C driver won't link against it.

This was found by my prototype implementation of HWASAN for globals, which
happens to end up preserving the reference.

Differential Revision: https://reviews.llvm.org/D64890

Modified:
    compiler-rt/trunk/test/hwasan/TestCases/cfi.cc

Modified: compiler-rt/trunk/test/hwasan/TestCases/cfi.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/hwasan/TestCases/cfi.cc?rev=366389&r1=366388&r2=366389&view=diff
==============================================================================
--- compiler-rt/trunk/test/hwasan/TestCases/cfi.cc (original)
+++ compiler-rt/trunk/test/hwasan/TestCases/cfi.cc Wed Jul 17 16:35:15 2019
@@ -1,4 +1,4 @@
-// RUN: %clang_hwasan -fsanitize=cfi -fno-sanitize-trap=cfi -flto -fvisibility=hidden -fuse-ld=lld %s -o %t
+// RUN: %clangxx_hwasan -fsanitize=cfi -fno-sanitize-trap=cfi -flto -fvisibility=hidden -fuse-ld=lld %s -o %t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
 // REQUIRES: android




More information about the llvm-commits mailing list