summaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM/globals.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-19 18:27:56 +0000
committerChris Lattner <sabre@nondot.org>2009-10-19 18:27:56 +0000
commit7bf4bc5a1d74696300cc7314a8bd14c7660aef0f (patch)
treefca856890921c2ab71636189a44506eef6bba40b /test/CodeGen/ARM/globals.ll
parent766fc1db1640499c6affce80e7337d8c22dc8cb1 (diff)
convert to filecheck syntax and make a lot more aggressive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84517 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/globals.ll')
-rw-r--r--test/CodeGen/ARM/globals.ll76
1 files changed, 68 insertions, 8 deletions
diff --git a/test/CodeGen/ARM/globals.ll b/test/CodeGen/ARM/globals.ll
index 56a4a477f51..8ed58bd53fe 100644
--- a/test/CodeGen/ARM/globals.ll
+++ b/test/CodeGen/ARM/globals.ll
@@ -1,11 +1,7 @@
-; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=static | \
-; RUN: not grep {L_G\$non_lazy_ptr}
-; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=dynamic-no-pic | \
-; RUN: grep {L_G\$non_lazy_ptr} | count 2
-; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=pic | \
-; RUN: grep {ldr.*pc} | count 1
-; RUN: llc < %s -mtriple=arm-linux-gnueabi -relocation-model=pic | \
-; RUN: grep {GOT} | count 1
+; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=static | FileCheck %s -check-prefix=DarwinStatic
+; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=dynamic-no-pic | FileCheck %s -check-prefix=DarwinDynamic
+; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=pic | FileCheck %s -check-prefix=DarwinPIC
+; RUN: llc < %s -mtriple=arm-linux-gnueabi -relocation-model=pic | FileCheck %s -check-prefix=LinuxPIC
@G = external global i32
@@ -13,3 +9,67 @@ define i32 @test1() {
%tmp = load i32* @G
ret i32 %tmp
}
+
+; DarwinStatic: _test1:
+; DarwinStatic: ldr r0, LCPI1_0
+; DarwinStatic: ldr r0, [r0]
+; DarwinStatic: bx lr
+
+; DarwinStatic: .align 2
+; DarwinStatic: LCPI1_0:
+; DarwinStatic: .long {{_G$}}
+
+
+; DarwinDynamic: _test1:
+; DarwinDynamic: ldr r0, LCPI1_0
+; DarwinDynamic: ldr r0, [r0]
+; DarwinDynamic: ldr r0, [r0]
+; DarwinDynamic: bx lr
+
+; DarwinDynamic: .align 2
+; DarwinDynamic: LCPI1_0:
+; DarwinDynamic: .long L_G$non_lazy_ptr
+
+; DarwinDynamic: .section __DATA,__nl_symbol_ptr,non_lazy_symbol_pointers
+; DarwinDynamic: .align 2
+; DarwinDynamic: L_G$non_lazy_ptr:
+; DarwinDynamic: .indirect_symbol _G
+; DarwinDynamic: .long 0
+
+
+
+; DarwinPIC: _test1:
+; DarwinPIC: ldr r0, LCPI1_0
+; DarwinPIC: LPC0:
+; DarwinPIC: ldr r0, [pc, +r0]
+; DarwinPIC: ldr r0, [r0]
+; DarwinPIC: bx lr
+
+; DarwinPIC: .align 2
+; DarwinPIC: LCPI1_0:
+; DarwinPIC: .long L_G$non_lazy_ptr-(LPC0+8)
+
+; DarwinPIC: .section __DATA,__nl_symbol_ptr,non_lazy_symbol_pointers
+; DarwinPIC: .align 2
+; DarwinPIC: L_G$non_lazy_ptr:
+; DarwinPIC: .indirect_symbol _G
+; DarwinPIC: .long 0
+
+
+
+; LinuxPIC: test1:
+; LinuxPIC: ldr r0, .LCPI1_0
+; LinuxPIC: ldr r1, .LCPI1_1
+
+; LinuxPIC: .LPC0:
+; LinuxPIC: add r0, pc, r0
+; LinuxPIC: ldr r0, [r1, +r0]
+; LinuxPIC: ldr r0, [r0]
+; LinuxPIC: bx lr
+
+; LinuxPIC: .align 2
+; LinuxPIC: .LCPI1_0:
+; LinuxPIC: .long _GLOBAL_OFFSET_TABLE_-(.LPC0+8)
+; LinuxPIC: .align 2
+; LinuxPIC: .LCPI1_1:
+; LinuxPIC: .long G(GOT)