1 ;RUN: llc -mtriple=armv7-eabi %s -o - | FileCheck %s
2 ;Test that global variables and functions are assigned to correct sections.
4 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
5 target triple = "armv7-arm-none-eabi"
7 @a = global i32 0, align 4 #0
8 @b = global i32 1, align 4 #0
9 @c = global [4 x i32] zeroinitializer, align 4 #0
10 @d = global [5 x i16] zeroinitializer, align 2 #0
11 @e = global [6 x i16] [i16 0, i16 0, i16 1, i16 0, i16 0, i16 0], align 2 #0
12 @f = constant i32 2, align 4 #0
13 @h = global i32 0, align 4 #1
14 @i = global i32 0, align 4 #2
15 @j = constant i32 4, align 4 #2
16 @k = global i32 0, align 4 #2
17 @_ZZ3gooE7lstat_h = internal global i32 0, align 4 #2
18 @_ZL1g = internal global [2 x i32] zeroinitializer, align 4 #0
19 @l = global i32 5, align 4 #3
20 @m = constant i32 6, align 4 #3
21 @n = global i32 0, align 4
22 @o = global i32 6, align 4
23 @p = constant i32 7, align 4
25 ; Function Attrs: noinline nounwind
26 define i32 @foo() #4 {
28 %0 = load i32, i32* @b, align 4
32 ; Function Attrs: noinline
33 define i32 @goo() #5 {
35 %call = call i32 @zoo(i32* getelementptr inbounds ([2 x i32], [2 x i32]* @_ZL1g, i32 0, i32 0), i32* @_ZZ3gooE7lstat_h)
39 declare i32 @zoo(i32*, i32*) #6
41 ; Function Attrs: noinline nounwind
42 define i32 @hoo() #7 {
44 %0 = load i32, i32* @b, align 4
48 attributes #0 = { "bss-section"="my_bss.1" "data-section"="my_data.1" "rodata-section"="my_rodata.1" }
49 attributes #1 = { "data-section"="my_data.1" "rodata-section"="my_rodata.1" }
50 attributes #2 = { "bss-section"="my_bss.2" "rodata-section"="my_rodata.1" }
51 attributes #3 = { "bss-section"="my_bss.2" "data-section"="my_data.2" "rodata-section"="my_rodata.2" }
52 attributes #4 = { noinline nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "denormal-fp-math"="preserve-sign" "disable-tail-calls"="false" "implicit-section-name"="my_text.1" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cortex-a9" "target-features"="+dsp,+fp16,+neon,+vfp3" "unsafe-fp-math"="false" "use-soft-float"="false" }
53 attributes #5 = { noinline "correctly-rounded-divide-sqrt-fp-math"="false" "denormal-fp-math"="preserve-sign" "disable-tail-calls"="false" "implicit-section-name"="my_text.2" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cortex-a9" "target-features"="+dsp,+fp16,+neon,+vfp3" "unsafe-fp-math"="false" "use-soft-float"="false" }
54 attributes #6 = { "correctly-rounded-divide-sqrt-fp-math"="false" "denormal-fp-math"="preserve-sign" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cortex-a9" "target-features"="+dsp,+fp16,+neon,+vfp3" "unsafe-fp-math"="false" "use-soft-float"="false" }
55 attributes #7 = { noinline nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "denormal-fp-math"="preserve-sign" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="cortex-a9" "target-features"="+dsp,+fp16,+neon,+vfp3" "unsafe-fp-math"="false" "use-soft-float"="false" }
57 !llvm.module.flags = !{!0, !1, !2, !3}
59 !0 = !{i32 1, !"wchar_size", i32 4}
60 !1 = !{i32 1, !"static_rwdata", i32 1}
61 !2 = !{i32 1, !"enumsize_buildattr", i32 2}
62 !3 = !{i32 1, !"armlib_unavailable", i32 0}
64 ;CHECK: .section my_text.1,"ax",%progbits
65 ;CHECK: .type foo,%function
68 ;CHECK: .section my_text.2,"ax",%progbits
69 ;CHECK: .type goo,%function
73 ;CHECK: .type hoo,%function
76 ;CHECK: .type a,%object
77 ;CHECK: .section my_bss.1,"aw",%nobits
80 ;CHECK: .type b,%object
81 ;CHECK: .section my_data.1,"aw",%progbits
84 ;CHECK: .type c,%object
85 ;CHECK: .section my_bss.1,"aw",%nobits
88 ;CHECK: .type d,%object
91 ;CHECK: .type e,%object
92 ;CHECK: .section my_data.1,"aw",%progbits
95 ;CHECK: .type f,%object
96 ;CHECK: .section my_rodata.1,"a",%progbits
99 ;CHECK: .type h,%object
103 ;CHECK: .type i,%object
104 ;CHECK: .section my_bss.2,"aw",%nobits
107 ;CHECK: .type j,%object
108 ;CHECK: .section my_rodata.1,"a",%progbits
111 ;CHECK: .type k,%object
112 ;CHECK: .section my_bss.2,"aw",%nobits
115 ;CHECK: .type _ZZ3gooE7lstat_h,%object @ @_ZZ3gooE7lstat_h
116 ;CHECK: _ZZ3gooE7lstat_h:
118 ;CHECK: .type _ZL1g,%object
119 ;CHECK: .section my_bss.1,"aw",%nobits
122 ;CHECK: .type l,%object
123 ;CHECK: .section my_data.2,"aw",%progbits
126 ;CHECK: .type m,%object
127 ;CHECK: .section my_rodata.2,"a",%progbits
130 ;CHECK: .type n,%object
134 ;CHECK: .type o,%object
138 ;CHECK: .type p,%object
139 ;CHECK: .section .rodata,"a",%progbits