summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/cfi/multiple-inheritance.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2015-02-21 01:36:08 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2015-02-21 01:36:08 +0000
commitf1d13da249d52dc549945aacb1c4059e4079e412 (patch)
treecc9e64995ca13aa4163ffc6bb988040755d63ee2 /compiler-rt/test/cfi/multiple-inheritance.cpp
parent5870373d19547b3e05bc1ec1df3b534d999e1d82 (diff)
downloadbcm5719-llvm-f1d13da249d52dc549945aacb1c4059e4079e412.tar.gz
bcm5719-llvm-f1d13da249d52dc549945aacb1c4059e4079e412.zip
CFI: Add tests for 32-bit, 64-bit and memory bitsets. Break optimization in more places.
llvm-svn: 230116
Diffstat (limited to 'compiler-rt/test/cfi/multiple-inheritance.cpp')
-rw-r--r--compiler-rt/test/cfi/multiple-inheritance.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/compiler-rt/test/cfi/multiple-inheritance.cpp b/compiler-rt/test/cfi/multiple-inheritance.cpp
index 1b03af4a1ba..523af6f72f2 100644
--- a/compiler-rt/test/cfi/multiple-inheritance.cpp
+++ b/compiler-rt/test/cfi/multiple-inheritance.cpp
@@ -2,6 +2,18 @@
// RUN: not --crash %t 2>&1 | FileCheck --check-prefix=CFI %s
// RUN: not --crash %t x 2>&1 | FileCheck --check-prefix=CFI %s
+// RUN: %clangxx_cfi -DB32 -o %t %s
+// RUN: not --crash %t 2>&1 | FileCheck --check-prefix=CFI %s
+// RUN: not --crash %t x 2>&1 | FileCheck --check-prefix=CFI %s
+
+// RUN: %clangxx_cfi -DB64 -o %t %s
+// RUN: not --crash %t 2>&1 | FileCheck --check-prefix=CFI %s
+// RUN: not --crash %t x 2>&1 | FileCheck --check-prefix=CFI %s
+
+// RUN: %clangxx_cfi -DBM -o %t %s
+// RUN: not --crash %t 2>&1 | FileCheck --check-prefix=CFI %s
+// RUN: not --crash %t x 2>&1 | FileCheck --check-prefix=CFI %s
+
// RUN: %clangxx -o %t %s
// RUN: %t 2>&1 | FileCheck --check-prefix=NCFI %s
// RUN: %t x 2>&1 | FileCheck --check-prefix=NCFI %s
@@ -10,6 +22,7 @@
// permits calls via virtual tables for the correct base class.
#include <stdio.h>
+#include "utils.h"
struct A {
virtual void f() = 0;
@@ -27,7 +40,29 @@ void C::f() {}
void C::g() {}
int main(int argc, char **argv) {
+#ifdef B32
+ break_optimization(new Deriver<A, 0>);
+ break_optimization(new Deriver<B, 0>);
+#endif
+
+#ifdef B64
+ break_optimization(new Deriver<A, 0>);
+ break_optimization(new Deriver<A, 1>);
+ break_optimization(new Deriver<B, 0>);
+ break_optimization(new Deriver<B, 1>);
+#endif
+
+#ifdef BM
+ break_optimization(new Deriver<A, 0>);
+ break_optimization(new Deriver<A, 1>);
+ break_optimization(new Deriver<A, 2>);
+ break_optimization(new Deriver<B, 0>);
+ break_optimization(new Deriver<B, 1>);
+ break_optimization(new Deriver<B, 2>);
+#endif
+
C *c = new C;
+ break_optimization(c);
// CFI: 1
// NCFI: 1
OpenPOWER on IntegriCloud