[compiler-rt] r278530 - Add compiler-rt side test for no_sanitize("cfi") attribute
Ivan Krasin via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 12 10:26:37 PDT 2016
Author: krasin
Date: Fri Aug 12 12:26:37 2016
New Revision: 278530
URL: http://llvm.org/viewvc/llvm-project?rev=278530&view=rev
Log:
Add compiler-rt side test for no_sanitize("cfi") attribute
Summary: Add a test case for __attribute__((no_sanitize("cfi"))) being effective.
Reviewers: kcc
Subscribers: dberris
Differential Revision: https://reviews.llvm.org/D23425
Modified:
compiler-rt/trunk/test/cfi/simple-fail.cpp
Modified: compiler-rt/trunk/test/cfi/simple-fail.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/cfi/simple-fail.cpp?rev=278530&r1=278529&r2=278530&view=diff
==============================================================================
--- compiler-rt/trunk/test/cfi/simple-fail.cpp (original)
+++ compiler-rt/trunk/test/cfi/simple-fail.cpp Fri Aug 12 12:26:37 2016
@@ -52,6 +52,9 @@
// RUN: %clangxx -o %t18 %s
// RUN: %t18 2>&1 | FileCheck --check-prefix=NCFI %s
+// RUN: %clangxx_cfi -DCHECK_NO_SANITIZE_CFI -o %t19 %s
+// RUN: %t19 2>&1 | FileCheck --check-prefix=NCFI %s
+
// Tests that the CFI mechanism crashes the program when making a virtual call
// to an object of the wrong class but with a compatible vtable, by casting a
// pointer to such an object and attempting to make a call through it.
@@ -73,6 +76,9 @@ struct B {
void B::f() {}
+#if defined(CHECK_NO_SANITIZE_CFI)
+__attribute__((no_sanitize("cfi")))
+#endif
int main() {
create_derivers<B>();
More information about the llvm-commits
mailing list