summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorAlexander Richardson <arichardson.kde@gmail.com>2018-01-26 15:56:14 +0000
committerAlexander Richardson <arichardson.kde@gmail.com>2018-01-26 15:56:14 +0000
commit1f9636f3ef64d71a115e4727a28349a9c7962d09 (patch)
tree27d4072a7abd52e4d8b2b36adcbe48acb0023c62 /llvm/test/CodeGen
parentf531cf8964c2d0e49a35bf4f05478b498b2a5fd4 (diff)
downloadbcm5719-llvm-1f9636f3ef64d71a115e4727a28349a9c7962d09.tar.gz
bcm5719-llvm-1f9636f3ef64d71a115e4727a28349a9c7962d09.zip
[MIPS] Don't crash on unsized extern types with -mgpopt
Summary: This fixes an assertion when building the FreeBSD MIPS64 kernel. Reviewers: atanasyan, sdardis, emaste Reviewed By: sdardis Subscribers: krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D42571 llvm-svn: 323536
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/Mips/unsized-global.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Mips/unsized-global.ll b/llvm/test/CodeGen/Mips/unsized-global.ll
new file mode 100644
index 00000000000..a89ecc1fd1c
--- /dev/null
+++ b/llvm/test/CodeGen/Mips/unsized-global.ll
@@ -0,0 +1,22 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; Check that -mgpopt doesn't crash on unsized externals
+; RUN: llc -mtriple=mips64-unknown-freebsd -mattr=+noabicalls -target-abi n64 -mgpopt -o - %s | FileCheck %s
+
+%struct.a = type opaque
+
+@b = external global %struct.a, align 1
+
+; Function Attrs: norecurse nounwind readnone
+define %struct.a* @d() {
+; CHECK-LABEL: d:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: lui $1, %highest(b)
+; CHECK-NEXT: daddiu $1, $1, %higher(b)
+; CHECK-NEXT: dsll $1, $1, 16
+; CHECK-NEXT: daddiu $1, $1, %hi(b)
+; CHECK-NEXT: dsll $1, $1, 16
+; CHECK-NEXT: jr $ra
+; CHECK-NEXT: daddiu $2, $1, %lo(b)
+entry:
+ ret %struct.a* @b
+}
OpenPOWER on IntegriCloud