diff options
Diffstat (limited to 'test/MC/ARM')
-rw-r--r-- | test/MC/ARM/arm_instructions.s | 6 | ||||
-rw-r--r-- | test/MC/ARM/elf-movt.s | 6 | ||||
-rw-r--r-- | test/MC/ARM/elf-thumbfunc-reloc.ll | 37 | ||||
-rw-r--r-- | test/MC/ARM/elf-thumbfunc.s | 20 | ||||
-rw-r--r-- | test/MC/ARM/simple-encoding.ll | 2 | ||||
-rw-r--r-- | test/MC/ARM/thumb.s | 5 | ||||
-rw-r--r-- | test/MC/ARM/thumb2.s | 2 | ||||
-rw-r--r-- | test/MC/ARM/xscale-attributes.ll | 31 |
8 files changed, 105 insertions, 4 deletions
diff --git a/test/MC/ARM/arm_instructions.s b/test/MC/ARM/arm_instructions.s index 50a2b704379b..f7894411ec56 100644 --- a/test/MC/ARM/arm_instructions.s +++ b/test/MC/ARM/arm_instructions.s @@ -270,6 +270,9 @@ @ CHECK: msr cpsr_fc, r0 @ encoding: [0x00,0xf0,0x29,0xe1] msr cpsr_fc, r0 +@ CHECK: msr cpsr_fc, r0 @ encoding: [0x00,0xf0,0x29,0xe1] + msr cpsr_all, r0 + @ CHECK: msr cpsr_fsx, r0 @ encoding: [0x00,0xf0,0x2e,0xe1] msr cpsr_fsx, r0 @@ -309,3 +312,6 @@ @ CHECK: ldrexd r0, r1, [r0] @ encoding: [0x9f,0x0f,0xb0,0xe1] ldrexd r0, r1, [r0] +@ CHECK: ssat16 r0, #7, r0 @ encoding: [0x30,0x0f,0xa6,0xe6] + ssat16 r0, #7, r0 + diff --git a/test/MC/ARM/elf-movt.s b/test/MC/ARM/elf-movt.s index 0fe7c50a3133..18061f57f519 100644 --- a/test/MC/ARM/elf-movt.s +++ b/test/MC/ARM/elf-movt.s @@ -9,10 +9,10 @@ barf: @ @barf @ BB#0: @ %entry movw r0, :lower16:GOT-(.LPC0_2+8) - movt r0, :upper16:GOT-(.LPC0_2+16) + movt r0, :upper16:GOT-(.LPC0_2+8) .LPC0_2: @ ASM: movw r0, :lower16:(GOT-(.LPC0_2+8)) -@ ASM-NEXT: movt r0, :upper16:(GOT-(.LPC0_2+16)) +@ ASM-NEXT: movt r0, :upper16:(GOT-(.LPC0_2+8)) @@ make sure that the text section fixups are sane too @ OBJ: '.text' @@ -25,7 +25,7 @@ barf: @ @barf @ OBJ-NEXT: 'sh_info', 0x00000000 @ OBJ-NEXT: 'sh_addralign', 0x00000004 @ OBJ-NEXT: 'sh_entsize', 0x00000000 -@ OBJ-NEXT: '_section_data', 'f00f0fe3 ff0f4fe3' +@ OBJ-NEXT: '_section_data', 'f00f0fe3 f40f4fe3' @ OBJ: Relocation 0x00000000 @ OBJ-NEXT: 'r_offset', 0x00000000 diff --git a/test/MC/ARM/elf-thumbfunc-reloc.ll b/test/MC/ARM/elf-thumbfunc-reloc.ll new file mode 100644 index 000000000000..6fce40388ed8 --- /dev/null +++ b/test/MC/ARM/elf-thumbfunc-reloc.ll @@ -0,0 +1,37 @@ +; RUN: llc %s -mtriple=thumbv7-linux-gnueabi -relocation-model=pic \ +; RUN: -filetype=obj -o - | elf-dump --dump-section-data | \ +; RUN: FileCheck %s + +; FIXME: This file needs to be in .s form! +; We wanna test relocatable thumb function call, +; but ARMAsmParser cannot handle "bl foo(PLT)" yet + +target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:32-n32" +target triple = "thumbv7-none--gnueabi" + +define void @foo() nounwind { +entry: + ret void +} + +define void @bar() nounwind { +entry: + call void @foo() + ret void +} + + +; make sure that bl 0 <foo> (fff7feff) is correctly encoded +; CHECK: '_section_data', '70470000 2de90048 fff7feff bde80088' + +; Offset Info Type Sym.Value Sym. Name +; 00000008 0000070a R_ARM_THM_CALL 00000001 foo +; CHECK: Relocation 0x00000000 +; CHECK-NEXT: 'r_offset', 0x00000008 +; CHECK-NEXT: 'r_sym', 0x00000007 +; CHECK-NEXT: 'r_type', 0x0000000a + +; make sure foo is thumb function: bit 0 = 1 +; CHECK: Symbol 0x00000007 +; CHECK-NEXT: 'foo' +; CHECK-NEXT: 'st_value', 0x00000001 diff --git a/test/MC/ARM/elf-thumbfunc.s b/test/MC/ARM/elf-thumbfunc.s new file mode 100644 index 000000000000..a1b3c311e8c1 --- /dev/null +++ b/test/MC/ARM/elf-thumbfunc.s @@ -0,0 +1,20 @@ +@@ test st_value bit 0 of thumb function +@ RUN: llvm-mc %s -triple=thumbv7-linux-gnueabi -filetype=obj -o - | \ +@ RUN: elf-dump | FileCheck %s + .syntax unified + .text + .globl foo + .align 2 + .type foo,%function + .code 16 + .thumb_func +foo: + bx lr + +@@ make sure foo is thumb function: bit 0 = 1 (st_value) +@CHECK: Symbol 0x00000004 +@CHECK-NEXT: 'st_name', 0x00000001 +@CHECK-NEXT: 'st_value', 0x00000001 +@CHECK-NEXT: 'st_size', 0x00000000 +@CHECK-NEXT: 'st_bind', 0x00000001 +@CHECK-NEXT: 'st_type', 0x00000002 diff --git a/test/MC/ARM/simple-encoding.ll b/test/MC/ARM/simple-encoding.ll index 7b581b3279fb..332280360d62 100644 --- a/test/MC/ARM/simple-encoding.ll +++ b/test/MC/ARM/simple-encoding.ll @@ -1,4 +1,4 @@ -;RUN: llc -mtriple=armv7-apple-darwin -show-mc-encoding -disable-cgp-branch-opts < %s | FileCheck %s +;RUN: llc -mtriple=armv7-apple-darwin -show-mc-encoding -disable-cgp-branch-opts -join-physregs < %s | FileCheck %s ;FIXME: Once the ARM integrated assembler is up and going, these sorts of tests diff --git a/test/MC/ARM/thumb.s b/test/MC/ARM/thumb.s index 342a390d81ac..55d9789f9de9 100644 --- a/test/MC/ARM/thumb.s +++ b/test/MC/ARM/thumb.s @@ -12,6 +12,8 @@ @ CHECK: blx r9 @ encoding: [0xc8,0x47] blx r9 +@ CHECK: blx r10 @ encoding: [0xd0,0x47] + blx r10 @ CHECK: rev r2, r3 @ encoding: [0x1a,0xba] @ CHECK: rev16 r3, r4 @ encoding: [0x63,0xba] @@ -68,3 +70,6 @@ @ CHECK: cpsie aif @ encoding: [0x67,0xb6] cpsie aif + +@ CHECK: mov r0, pc @ encoding: [0x78,0x46] + mov r0, pc diff --git a/test/MC/ARM/thumb2.s b/test/MC/ARM/thumb2.s index 5342b9001e47..4e9d4e18597e 100644 --- a/test/MC/ARM/thumb2.s +++ b/test/MC/ARM/thumb2.s @@ -300,3 +300,5 @@ ldrex r0, [r0] @ CHECK: ldrexd r0, r1, [r0] @ encoding: [0xd0,0xe8,0x7f,0x01] ldrexd r0, r1, [r0] +@ CHECK: ssat16 r0, #7, r0 @ encoding: [0x20,0xf3,0x06,0x00] + ssat16 r0, #7, r0 diff --git a/test/MC/ARM/xscale-attributes.ll b/test/MC/ARM/xscale-attributes.ll new file mode 100644 index 000000000000..e576278c3dcf --- /dev/null +++ b/test/MC/ARM/xscale-attributes.ll @@ -0,0 +1,31 @@ +; RUN: llc %s -mtriple=thumbv5-linux-gnueabi -mcpu=xscale -o - | \ +; RUN: FileCheck -check-prefix=ASM %s + +; RUN: llc %s -mtriple=thumbv5-linux-gnueabi -filetype=obj \ +; RUN: -mcpu=xscale -o - | elf-dump --dump-section-data | \ +; RUN: FileCheck -check-prefix=OBJ %s + +; FIXME: The OBJ test should be a .s to .o test and the ASM test should +; be moved to test/CodeGen/ARM. + +define void @foo() nounwind { +entry: + ret void +} + +; ASM: .eabi_attribute 6, 5 +; ASM-NEXT: .eabi_attribute 8, 1 +; ASM-NEXT: .eabi_attribute 9, 1 + +; OBJ: Section 0x00000004 +; OBJ-NEXT: 'sh_name', 0x0000000c +; OBJ-NEXT: 'sh_type', 0x70000003 +; OBJ-NEXT: 'sh_flags', 0x00000000 +; OBJ-NEXT: 'sh_addr', 0x00000000 +; OBJ-NEXT: 'sh_offset', 0x00000038 +; OBJ-NEXT: 'sh_size', 0x00000020 +; OBJ-NEXT: 'sh_link', 0x00000000 +; OBJ-NEXT: 'sh_info', 0x00000000 +; OBJ-NEXT: 'sh_addralign', 0x00000001 +; OBJ-NEXT: 'sh_entsize', 0x00000000 +; OBJ-NEXT: '_section_data', '411f0000 00616561 62690001 15000000 06050801 09011401 15011703 18011901' |