summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2017-10-17 06:37:58 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2017-10-17 06:37:58 +0000
commit20fc63351d3c58780f7b64918c306820ed98acce (patch)
treeba345fafbefeb12ab7bcf560150f65e9f17cc497 /llvm/test
parent6a7bbfb2e26ce9a39a69fccff8383ba7f484e2e2 (diff)
downloadbcm5719-llvm-20fc63351d3c58780f7b64918c306820ed98acce.tar.gz
bcm5719-llvm-20fc63351d3c58780f7b64918c306820ed98acce.zip
[NFC] Add test from bug 34937
llvm-svn: 315976
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/GVN/PRE/2017-10-16-LoadPRECrash.ll32
1 files changed, 32 insertions, 0 deletions
diff --git a/llvm/test/Transforms/GVN/PRE/2017-10-16-LoadPRECrash.ll b/llvm/test/Transforms/GVN/PRE/2017-10-16-LoadPRECrash.ll
new file mode 100644
index 00000000000..5fbb0fcc511
--- /dev/null
+++ b/llvm/test/Transforms/GVN/PRE/2017-10-16-LoadPRECrash.ll
@@ -0,0 +1,32 @@
+; RUN: opt -S -gvn -enable-load-pre < %s | FileCheck %s
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+%ArrayImpl = type { i64, i64 addrspace(100)*, [1 x i64], [1 x i64], [1 x i64], i64, i64, double addrspace(100)*, double addrspace(100)*, i8, i64 }
+
+; Function Attrs: readnone
+declare %ArrayImpl* @getaddr_ArrayImpl(%ArrayImpl addrspace(100)*) #0
+
+; Function Attrs: readnone
+declare i64* @getaddr_i64(i64 addrspace(100)*) #0
+
+; Make sure that the test compiles without a crash.
+; Bug https://bugs.llvm.org/show_bug.cgi?id=34937
+
+define hidden void @wrapon_fn173() {
+
+; CHECK-LABEL: @wrapon_fn173
+
+entry:
+ %0 = call %ArrayImpl* @getaddr_ArrayImpl(%ArrayImpl addrspace(100)* undef)
+ br label %loop
+
+loop:
+ %1 = call %ArrayImpl* @getaddr_ArrayImpl(%ArrayImpl addrspace(100)* undef)
+ %2 = load i64 addrspace(100)*, i64 addrspace(100)** null, align 8
+ %3 = call i64* @getaddr_i64(i64 addrspace(100)* %2)
+ br label %loop
+}
+
+attributes #0 = { readnone }
OpenPOWER on IntegriCloud