diff options
author | Hans Wennborg <hans@hanshq.net> | 2018-02-02 13:47:07 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2018-02-02 13:47:07 +0000 |
commit | 52d11d163ef739537988545ba54a8b6fc1e18bcb (patch) | |
tree | 3d15b9a7fefe298037d53e19a1281e9278575ab0 /test | |
parent | 7e8d1e7421f89de424e8ddf40d1948588e0dc3e9 (diff) |
Merging r323536:
------------------------------------------------------------------------
r323536 | arichardson | 2018-01-26 16:56:14 +0100 (Fri, 26 Jan 2018) | 11 lines
[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
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_60@324087 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/Mips/unsized-global.ll | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/unsized-global.ll b/test/CodeGen/Mips/unsized-global.ll new file mode 100644 index 00000000000..a89ecc1fd1c --- /dev/null +++ b/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 +} |