forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MIPS/Asm/O32: Don't add another $ to PrivateGlobal symbol
For asm code like: xx: la $2,$yy $yy: nop MIPS O32 use `$` as PrivateGlobalPrefix, while another `$` is added for getOrCreateSymbol, thus: error: Undefined temporary symbol $$yy We also set symbols that starts with `.L` as local for O32. See: llvm#65020.
- Loading branch information
Showing
3 changed files
with
31 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips32r2 | \ | ||
# RUN: FileCheck %s --check-prefixes=CHECK | ||
# RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips32r6 | \ | ||
# RUN: FileCheck %s --check-prefixes=CHECK | ||
|
||
.text | ||
.abicalls | ||
.option pic2 | ||
xx: | ||
la $2,.Lhello #CHECK: lw $2, %got(.Lhello)($gp) # encoding: [0x8f,0x82,A,A] | ||
#CHECK: # fixup A - offset: 0, value: %got(.Lhello), kind: fixup_Mips_GOT | ||
#CHECK: addiu $2, $2, %lo(.Lhello) # encoding: [0x24,0x42,A,A] | ||
#CHECK: # fixup A - offset: 0, value: %lo(.Lhello), kind: fixup_Mips_LO16 | ||
|
||
la $2,$hello2 #CHECK: lw $2, %got($hello2)($gp) # encoding: [0x8f,0x82,A,A] | ||
#CHECK: # fixup A - offset: 0, value: %got($hello2), kind: fixup_Mips_GOT | ||
#CHECK: addiu $2, $2, %lo($hello2) # encoding: [0x24,0x42,A,A] | ||
#CHECK: # fixup A - offset: 0, value: %lo($hello2), kind: fixup_Mips_LO16 | ||
.rdata | ||
.Lhello: | ||
.asciz "Hello world\n" | ||
$hello2: | ||
.asciz "Hello world\n" |