diff options
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/MC/Mips/mips-pdr-bad.s | 42 | ||||
-rw-r--r-- | llvm/test/MC/Mips/mips-pdr.s | 64 |
2 files changed, 106 insertions, 0 deletions
diff --git a/llvm/test/MC/Mips/mips-pdr-bad.s b/llvm/test/MC/Mips/mips-pdr-bad.s new file mode 100644 index 00000000000..40c6ba2a1f2 --- /dev/null +++ b/llvm/test/MC/Mips/mips-pdr-bad.s @@ -0,0 +1,42 @@ +# RUN: not llvm-mc %s -arch=mips -mcpu=mips32r2 2>%t1 +# RUN: FileCheck %s < %t1 -check-prefix=ASM + + .text + + .ent # ASM: :[[@LINE]]:14: error: expected identifier after .ent + .ent bar, # ASM: :[[@LINE]]:19: error: expected number after comma + .ent foo, bar # AMS: :[[@LINE]]:23: error: expected an absolute expression after comma + .ent foo, 5, bar # AMS: :[[@LINE]]:20: error: unexpected token, expected end of statement + + .frame # ASM: :[[@LINE]]:16: error: expected stack register + .frame bar # ASM: :[[@LINE]]:16: error: expected stack register + .frame $f1, 8, # ASM: :[[@LINE]]:16: error: expected general purpose register + .frame $sp # ASM: :[[@LINE]]:20: error: unexpected token, expected comma + .frame $sp, # ASM: :[[@LINE]]:21: error: expected frame size value + .frame $sp, bar # ASM: :[[@LINE]]:25: error: frame size not an absolute expression + .frame $sp, 8 # ASM: :[[@LINE]]:23: error: unexpected token, expected comma + .frame $sp, 8, # ASM: :[[@LINE]]:24: error: expected return register + .frame $sp, 8, $f1 # ASM: :[[@LINE]]:24: error: expected general purpose register + .frame $sp, 8, $ra, foo # ASM: :[[@LINE]]:27: error: unexpected token, expected end of statement + + .mask # ASM: :[[@LINE]]:16: error: expected bitmask value + .mask foo # ASM: :[[@LINE]]:19: error: bitmask not an absolute expression + .mask 0x80000000 # ASM: :[[@LINE]]:26: error: unexpected token, expected comma + .mask 0x80000000, # ASM: :[[@LINE]]:27: error: expected frame offset value + .mask 0x80000000, foo # ASM: :[[@LINE]]:31: error: frame offset not an absolute expression + .mask 0x80000000, -4, bar # ASM: :[[@LINE]]:29: error: unexpected token, expected end of statement + + .fmask # ASM: :[[@LINE]]:17: error: expected bitmask value + .fmask foo # ASM: :[[@LINE]]:20: error: bitmask not an absolute expression + .fmask 0x80000000 # ASM: :[[@LINE]]:27: error: unexpected token, expected comma + .fmask 0x80000000, # ASM: :[[@LINE]]:28: error: expected frame offset value + .fmask 0x80000000, foo # ASM: :[[@LINE]]:32: error: frame offset not an absolute expression + .fmask 0x80000000, -4, bar # ASM: :[[@LINE]]:30: error: unexpected token, expected end of statement + + .end # ASM: :[[@LINE]]:14: error: expected identifier after .end + .ent _local_foo_bar + .end _local_foo_bar, foo # ASM: :[[@LINE]]:28: error: unexpected token, expected end of statement + .end _local_foo_bar + .end _local_foo # ASM: :[[@LINE]]:25: error: .end used without .ent + .ent _local_foo, 2 + .end _local_foo_bar # ASM: :[[@LINE]]:29: error: .end symbol does not match .ent symbol diff --git a/llvm/test/MC/Mips/mips-pdr.s b/llvm/test/MC/Mips/mips-pdr.s new file mode 100644 index 00000000000..372c259bb09 --- /dev/null +++ b/llvm/test/MC/Mips/mips-pdr.s @@ -0,0 +1,64 @@ +# RUN: llvm-mc %s -arch=mips -mcpu=mips32r2 -filetype=asm | \ +# RUN: FileCheck %s -check-prefix=ASMOUT + +# RUN: llvm-mc %s -arch=mips -mcpu=mips32r2 -filetype=obj -o - | \ +# RUN: llvm-readobj -s -section-data | \ +# RUN: FileCheck %s -check-prefix=OBJOUT + +# ASMOUT: .text +# ASMOUT: .type _local_foo,@function +# ASMOUT: .ent _local_foo +# ASMOUT:_local_foo: +# ASMOUT: .frame $fp,16,$ra +# ASMOUT: .mask 0x10101010,-4 +# ASMOUT: .fmask 0x01010101,-8 +# ASMOUT: .end _local_foo +# ASMOUT: .size local_foo, + +# OBJOUT: Section { +# OBJOUT: Name: .pdr +# OBJOUT: Type: SHT_PROGBITS (0x1) +# OBJOUT: Flags [ (0xB) +# OBJOUT: SHF_ALLOC (0x2) +# OBJOUT: SHF_WRITE (0x1) +# OBJOUT: ] +# OBJOUT: Size: 64 +# OBJOUT: SectionData ( +# OBJOUT: 0000: 00000000 10101010 FFFFFFFC 01010101 +# OBJOUT: 0010: FFFFFFF8 00000010 0000001E 0000001F +# OBJOUT: 0020: 00000000 10101010 FFFFFFFC 01010101 +# OBJOUT: 0030: FFFFFFF8 00000010 0000001E 0000001F +# OBJOUT: ) +# OBJOUT: } + +# We should also check if relocation information was correctly generated. +# OBJOUT: Section { +# OBJOUT: Name: .rel.pdr +# OBJOUT: Type: SHT_REL (0x9) +# OBJOUT: Flags [ (0x0) +# OBJOUT: ] +# OBJOUT: Size: 16 +# OBJOUT: SectionData ( +# OBJOUT: 0000: 00000000 00000202 00000020 00000802 +# OBJOUT: ) +# OBJOUT: } + +.text + .type _local_foo,@function + .ent _local_foo +_local_foo: + .frame $fp,16,$ra + .mask 0x10101010,-4 + .fmask 0x01010101,-8 + .end _local_foo + .size local_foo,.-_local_foo + + .globl _global_foo + .type _global_foo,@function + .ent _global_foo +_global_foo: + .frame $fp,16,$ra + .mask 0x10101010,-4 + .fmask 0x01010101,-8 + .end _global_foo + .size global_foo,.-_global_foo |