summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/cfi/overwrite.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-06-25 00:24:22 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-06-25 00:24:22 +0000
commitc79ad577fb6aa2a02c83c8787a9f2a41e80de2cc (patch)
treef27fe81d6b6e130a636a05c7694b79007db03a69 /compiler-rt/test/cfi/overwrite.cpp
parent0ca0363d052425c5788aafeafe6030264c25cdb2 (diff)
downloadbcm5719-llvm-c79ad577fb6aa2a02c83c8787a9f2a41e80de2cc.tar.gz
bcm5719-llvm-c79ad577fb6aa2a02c83c8787a9f2a41e80de2cc.zip
cfi: Start testing CFI in both standalone and devirtualization modes.
Differential Revision: http://reviews.llvm.org/D21123 llvm-svn: 273758
Diffstat (limited to 'compiler-rt/test/cfi/overwrite.cpp')
-rw-r--r--compiler-rt/test/cfi/overwrite.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler-rt/test/cfi/overwrite.cpp b/compiler-rt/test/cfi/overwrite.cpp
index 90f995d87bc..48c0a89c8f6 100644
--- a/compiler-rt/test/cfi/overwrite.cpp
+++ b/compiler-rt/test/cfi/overwrite.cpp
@@ -1,5 +1,5 @@
// RUN: %clangxx_cfi -o %t1 %s
-// RUN: %expect_crash %t1 2>&1 | FileCheck --check-prefix=CFI %s
+// RUN: %expect_crash_unless_devirt %t1 2>&1 | FileCheck --check-prefix=CFI %s
// RUN: %clangxx_cfi -DB32 -o %t2 %s
// RUN: %expect_crash %t2 2>&1 | FileCheck --check-prefix=CFI %s
@@ -55,7 +55,10 @@ int main() {
// CFI-DIAG-NEXT: note: invalid vtable
a->f();
- // CFI-NOT: {{^2$}}
+ // We don't check for the absence of a 2 here because under devirtualization
+ // our virtual call may be devirtualized and we will proceed with execution
+ // rather than crashing.
+
// NCFI: {{^2$}}
fprintf(stderr, "2\n");
}
OpenPOWER on IntegriCloud