2
2
; RUN: llc -mtriple=sparc -relocation-model=pic < %s | FileCheck --check-prefix=SPARC %s
3
3
; RUN: llc -mtriple=sparc64 -relocation-model=pic < %s | FileCheck --check-prefix=SPARC64 %s
4
4
5
- ;; TODO: Fix the code generation for these functions.
6
-
7
5
@x = external thread_local global i8
8
6
9
7
;; Test that we don't over-allocate stack space when calling __tls_get_addr
@@ -29,7 +27,7 @@ define ptr @no_alloca() nounwind {
29
27
;
30
28
; SPARC64-LABEL: no_alloca:
31
29
; SPARC64: ! %bb.0: ! %entry
32
- ; SPARC64-NEXT: save %sp, -144 , %sp
30
+ ; SPARC64-NEXT: save %sp, -128 , %sp
33
31
; SPARC64-NEXT: .Ltmp0:
34
32
; SPARC64-NEXT: rd %pc, %o7
35
33
; SPARC64-NEXT: .Ltmp2:
@@ -62,13 +60,11 @@ define ptr @dynamic_alloca(i64 %n) nounwind {
62
60
; SPARC-NEXT: .Ltmp4:
63
61
; SPARC-NEXT: or %i0, %lo(_GLOBAL_OFFSET_TABLE_+(.Ltmp4-.Ltmp3)), %i0
64
62
; SPARC-NEXT: add %i0, %o7, %i0
65
- ; SPARC-NEXT: add %sp, -1, %sp
66
63
; SPARC-NEXT: sethi %tgd_hi22(x), %i2
67
64
; SPARC-NEXT: add %i2, %tgd_lo10(x), %i2
68
65
; SPARC-NEXT: add %i0, %i2, %o0, %tgd_add(x)
69
66
; SPARC-NEXT: call __tls_get_addr, %tgd_call(x)
70
67
; SPARC-NEXT: nop
71
- ; SPARC-NEXT: add %sp, 1, %sp
72
68
; SPARC-NEXT: add %i1, 7, %i0
73
69
; SPARC-NEXT: and %i0, -8, %i0
74
70
; SPARC-NEXT: sub %sp, %i0, %i0
@@ -88,13 +84,11 @@ define ptr @dynamic_alloca(i64 %n) nounwind {
88
84
; SPARC64-NEXT: .Ltmp4:
89
85
; SPARC64-NEXT: or %i1, %lo(_GLOBAL_OFFSET_TABLE_+(.Ltmp4-.Ltmp3)), %i1
90
86
; SPARC64-NEXT: add %i1, %o7, %i1
91
- ; SPARC64-NEXT: add %sp, -1, %sp
92
87
; SPARC64-NEXT: sethi %tgd_hi22(x), %i2
93
88
; SPARC64-NEXT: add %i2, %tgd_lo10(x), %i2
94
89
; SPARC64-NEXT: add %i1, %i2, %o0, %tgd_add(x)
95
90
; SPARC64-NEXT: call __tls_get_addr, %tgd_call(x)
96
91
; SPARC64-NEXT: nop
97
- ; SPARC64-NEXT: add %sp, 1, %sp
98
92
; SPARC64-NEXT: add %i0, 15, %i0
99
93
; SPARC64-NEXT: and %i0, -16, %i0
100
94
; SPARC64-NEXT: sub %sp, %i0, %i0
0 commit comments