summaryrefslogtreecommitdiffstats
path: root/llvm/test/LTO/Resolution
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-05-26 18:27:13 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-05-26 18:27:13 +0000
commit7730b244480c4a2b12dc3bff9892bb989f8b3e9c (patch)
tree21133c56ae187cad10fd78160d95a39c124af049 /llvm/test/LTO/Resolution
parentd45185f231d1aa710774f8866bbe2320573103f7 (diff)
downloadbcm5719-llvm-7730b244480c4a2b12dc3bff9892bb989f8b3e9c.tar.gz
bcm5719-llvm-7730b244480c4a2b12dc3bff9892bb989f8b3e9c.zip
PMB: Run the whole-program-devirt pass during LTO at --lto-O0.
The whole-program-devirt pass needs to run at -O0 because only it knows about the llvm.type.checked.load intrinsic: it needs to both lower the intrinsic itself and handle it in the summary. Differential Revision: https://reviews.llvm.org/D33571 llvm-svn: 304019
Diffstat (limited to 'llvm/test/LTO/Resolution')
-rw-r--r--llvm/test/LTO/Resolution/X86/type-checked-load.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/LTO/Resolution/X86/type-checked-load.ll b/llvm/test/LTO/Resolution/X86/type-checked-load.ll
new file mode 100644
index 00000000000..3ec783bc565
--- /dev/null
+++ b/llvm/test/LTO/Resolution/X86/type-checked-load.ll
@@ -0,0 +1,16 @@
+; RUN: llvm-as -o %t %s
+; RUN: llvm-lto2 run %t -O0 -r %t,foo,px -o %t2
+
+; This just tests that we don't crash when compiling this test case.
+; It means that the wholeprogramdevirt pass must have run and lowered
+; the llvm.type.checked.load call.
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define {i8*, i1} @foo(i8* %ptr) {
+ %pair = call {i8*, i1} @llvm.type.checked.load(i8* %ptr, i32 16, metadata !"foo")
+ ret {i8*, i1} %pair
+}
+
+declare {i8*, i1} @llvm.type.checked.load(i8* %ptr, i32 %offset, metadata %type)
OpenPOWER on IntegriCloud