summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/ThinLTOBitcodeWriter
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-03-02 23:10:17 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-03-02 23:10:17 +0000
commit3baa72af7d65c3d5199b3d57bfa2b6c1268306b2 (patch)
tree52ad5b614d7aea24876bb24f08bf12f7bff27e4b /llvm/test/Transforms/ThinLTOBitcodeWriter
parentdcb004fdf1dbebc2792fe27c4f1c638e84066d8b (diff)
downloadbcm5719-llvm-3baa72af7d65c3d5199b3d57bfa2b6c1268306b2.tar.gz
bcm5719-llvm-3baa72af7d65c3d5199b3d57bfa2b6c1268306b2.zip
ThinLTOBitcodeWriter: Do not follow operand edges of type GlobalValue when looking for virtual functions.
Such edges may otherwise result in infinite recursion if a pointer to a vtable is reachable from the vtable itself. This can happen in practice if a TU defines the ABI types used to implement RTTI, and is itself compiled with RTTI. Fixes PR32121. llvm-svn: 296839
Diffstat (limited to 'llvm/test/Transforms/ThinLTOBitcodeWriter')
-rw-r--r--llvm/test/Transforms/ThinLTOBitcodeWriter/circular-reference.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/circular-reference.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/circular-reference.ll
new file mode 100644
index 00000000000..eeda7932449
--- /dev/null
+++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/circular-reference.ll
@@ -0,0 +1,9 @@
+; RUN: opt -thinlto-bc -o %t %s
+; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=M0 %s
+; RUN: llvm-modextract -b -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=M1 %s
+
+; M0: @g = external constant
+; M1: @g = constant
+@g = constant i8* bitcast (i8** @g to i8*), !type !0
+
+!0 = !{i32 0, !"typeid"}
OpenPOWER on IntegriCloud