46 lines · plain
1; RUN: llc -mtriple=sparc --relocation-model=pic < %s | FileCheck %s --check-prefix=V82; RUN: llc -mtriple=sparcv9 --relocation-model=pic < %s | FileCheck %s --check-prefix=V93; RUN: llc -mtriple=sparc --relocation-model=pic < %s -O0 | FileCheck %s --check-prefix=V8UNOPT4; RUN: llc -mtriple=sparcv9 --relocation-model=pic < %s -O0 | FileCheck %s --check-prefix=V9UNOPT5 6 7; V8-LABEL: func8; V8: _GLOBAL_OFFSET_TABLE_9 10; V9-LABEL: func11; V9: _GLOBAL_OFFSET_TABLE_12 13@foo = global i32 0 ; <i32*> [#uses=1]14 15define i32 @func(i32 %a) nounwind readonly {16entry:17 %0 = load i32, ptr @foo, align 4 ; <i32> [#uses=1]18 ret i32 %019}20 21; V8UNOPT-LABEL: test_spill22; 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+{{.+}}]26 27; V9UNOPT-LABEL: test_spill28; 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+{{.+}}]32 33define i32 @test_spill(i32 %a, i32 %b) {34entry:35 %cmp = icmp eq i32 %b, 036 br i1 %cmp, label %if.then, label %if.end37 38if.then:39 %ret = load i32, ptr @foo, align 440 ret i32 %ret41 42if.end:43 %add = add nsw i32 %b, %a44 ret i32 %add45}46