1 ; RUN: llc -march=sparc --relocation-model=pic < %s | FileCheck %s --check-prefix=V8
2 ; RUN: llc -march=sparcv9 --relocation-model=pic < %s | FileCheck %s --check-prefix=V9
3 ; RUN: llc -march=sparc --relocation-model=pic < %s -O0 | FileCheck %s --check-prefix=V8UNOPT
4 ; RUN: llc -march=sparcv9 --relocation-model=pic < %s -O0 | FileCheck %s --check-prefix=V9UNOPT
8 ; V8: _GLOBAL_OFFSET_TABLE_
11 ; V9: _GLOBAL_OFFSET_TABLE_
13 @foo = global i32 0 ; <i32*> [#uses=1]
15 define i32 @func(i32 %a) nounwind readonly {
17 %0 = load i32, i32* @foo, align 4 ; <i32> [#uses=1]
21 ; V8UNOPT-LABEL: test_spill
22 ; V8UNOPT: sethi %hi(_GLOBAL_OFFSET_TABLE_+{{.+}}), [[R:%[goli][0-7]]]
23 ; V8UNOPT: or [[R]], %lo(_GLOBAL_OFFSET_TABLE_+{{.+}}), [[R]]
24 ; V8UNOPT: add [[R]], %o7, [[R]]
25 ; V8UNOPT: st [[R]], [%fp+{{.+}}]
27 ; V9UNOPT-LABEL: test_spill
28 ; V9UNOPT: sethi %hi(_GLOBAL_OFFSET_TABLE_+{{.+}}), [[R:%[goli][0-7]]]
29 ; V9UNOPT: or [[R]], %lo(_GLOBAL_OFFSET_TABLE_+{{.+}}), [[R]]
30 ; V9UNOPT: add [[R]], %o7, [[R]]
31 ; V9UNOPT: stx [[R]], [%fp+{{.+}}]
33 define i32 @test_spill(i32 %a, i32 %b) {
35 %cmp = icmp eq i32 %b, 0
36 br i1 %cmp, label %if.then, label %if.end
39 %ret = load i32, i32* @foo, align 4
43 %add = add nsw i32 %b, %a