Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mips][ias] Fix N32 and N64 .cprestore directive when inside .set noa…
…t region. Summary: r268058 unintentionally made the retrieval of the current assembler temporary unconditional. This was fine for the existing tests but it broke the cases where the assembler temporary is not needed (N32/N64 or not PIC) and is unavailable due to a '.set noat' directive. This fixes FreeBSD's libc. Reviewers: emaste, sdardis, seanbruno Subscribers: dsanders, emaste, sdardis, llvm-commits Differential Revision: http://reviews.llvm.org/D20093 llvm-svn: 269179
- Loading branch information
1 parent
8b4b8c2
commit df8510d
Showing
4 changed files
with
64 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# RUN: not llvm-mc %s -arch=mips -mcpu=mips32 -relocation-model=pic -filetype=obj \ | ||
# RUN: -o /dev/null 2>&1 | FileCheck %s -check-prefix=O32 | ||
|
||
# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -relocation-model=pic \ | ||
# RUN: -filetype=obj -o /dev/null 2>&1 | FileCheck %s -allow-empty -check-prefix=N32 | ||
|
||
# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -relocation-model=pic -target-abi=n32 \ | ||
# RUN: -filetype=obj -o /dev/null 2>&1 | FileCheck %s -allow-empty -check-prefix=N64 | ||
|
||
# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -relocation-model=pic -target-abi=n32 \ | ||
# RUN: -filetype=obj -o - | llvm-objdump -d -r - | \ | ||
# RUN: FileCheck %s -check-prefix=NO-STORE | ||
|
||
# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -relocation-model=pic -filetype=obj -o - | \ | ||
# RUN: llvm-objdump -d -r - | \ | ||
# RUN: FileCheck %s -check-prefix=NO-STORE | ||
|
||
.text | ||
.ent foo | ||
foo: | ||
.frame $sp, 0, $ra | ||
.set noreorder | ||
.set noat | ||
|
||
.cpload $25 | ||
.cprestore 8 | ||
# O32: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available | ||
# N32-NOT: error: pseudo-instruction requires $at, which is not available | ||
# N64-NOT: error: pseudo-instruction requires $at, which is not available | ||
# NO-STORE-NOT: sw $gp, 8($sp) | ||
|
||
jal $25 | ||
jal $4, $25 | ||
jal foo | ||
|
||
.end foo |