1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
;RUN: llc -mtriple=x86_64-windows-msvc %s -o - | FileCheck %s
;Test that global variables and functions are assigned to correct sections.
@a = global i32 0, align 4 #0
@b = global i32 1, align 4 #0
@c = global [4 x i32] zeroinitializer, align 4 #0
@d = global [5 x i16] zeroinitializer, align 2 #0
@e = global [6 x i16] [i16 0, i16 0, i16 1, i16 0, i16 0, i16 0], align 2 #0
@f = constant i32 2, align 4 #0
@h = global i32 0, align 4 #1
@i = global i32 0, align 4 #2
@j = constant i32 4, align 4 #2
@k = global i32 0, align 4 #2
@_ZZ3gooE7lstat_h = internal global i32 0, align 4 #2
@_ZL1g = internal global [2 x i32] zeroinitializer, align 4 #0
@l = global i32 5, align 4 #3
@m = constant i32 6, align 4 #3
@n = global i32 0, align 4
@o = global i32 6, align 4
@p = constant i32 7, align 4
declare i32 @zoo(ptr, ptr) #6
; Function Attrs: noinline nounwind
define i32 @hoo() #7 {
; CHECK-LABEL: hoo:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl b(%rip), %eax
; CHECK-NEXT: retq
entry:
%0 = load i32, ptr @b, align 4
ret i32 %0
}
attributes #0 = { "bss-section"="my_bss.1" "data-section"="my_data.1" "rodata-section"="my_rodata.1" }
attributes #1 = { "data-section"="my_data.1" "rodata-section"="my_rodata.1" }
attributes #2 = { "bss-section"="my_bss.2" "rodata-section"="my_rodata.1" }
attributes #3 = { "bss-section"="my_bss.2" "data-section"="my_data.2" "rodata-section"="my_rodata.2" }
attributes #6 = { "correctly-rounded-divide-sqrt-fp-math"="false" "denormal-fp-math"="preserve-sign,preserve-sign" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "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" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #7 = { noinline nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "denormal-fp-math"="preserve-sign,preserve-sign" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "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" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.module.flags = !{!0, !1, !2, !3}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 1, !"static_rwdata", i32 1}
!2 = !{i32 1, !"enumsize_buildattr", i32 2}
!3 = !{i32 1, !"armlib_unavailable", i32 0}
;CHECK: .section my_bss.1,"bw"
;CHECK: .globl a # @a
;CHECK: .p2align 2, 0x0
;CHECK: a:
;CHECK: .long 0 # 0x0
;CHECK: .section my_data.1,"dw"
;CHECK: .globl b # @b
;CHECK: .p2align 2, 0x0
;CHECK: b:
;CHECK: .long 1 # 0x1
;CHECK: .section my_bss.1,"bw"
;CHECK: .globl c # @c
;CHECK: .p2align 2, 0x0
;CHECK: c:
;CHECK: .zero 16
;CHECK: .globl d # @d
;CHECK: .p2align 1, 0x0
;CHECK: d:
;CHECK: .zero 10
;CHECK: .section my_data.1,"dw"
;CHECK: .globl e # @e
;CHECK: .p2align 1, 0x0
;CHECK: e:
;CHECK: .short 0 # 0x0
;CHECK: .short 0 # 0x0
;CHECK: .short 1 # 0x1
;CHECK: .short 0 # 0x0
;CHECK: .short 0 # 0x0
;CHECK: .short 0 # 0x0
;CHECK: .section my_rodata.1,"dr"
;CHECK: .globl f # @f
;CHECK: .p2align 2, 0x0
;CHECK: f:
;CHECK: .long 2 # 0x2
;CHECK: .bss
;CHECK: .globl h # @h
;CHECK: .p2align 2, 0x0
;CHECK: h:
;CHECK: .long 0 # 0x0
;CHECK: .section my_bss.2,"bw"
;CHECK: .globl i # @i
;CHECK: .p2align 2, 0x0
;CHECK: i:
;CHECK: .long 0 # 0x0
;CHECK: .section my_rodata.1,"dr"
;CHECK: .globl j # @j
;CHECK: .p2align 2, 0x0
;CHECK: j:
;CHECK: .long 4 # 0x4
;CHECK: .section my_bss.2,"bw"
;CHECK: .globl k # @k
;CHECK: .p2align 2, 0x0
;CHECK: k:
;CHECK: .long 0 # 0x0
;CHECK: .p2align 2, 0x0 # @_ZZ3gooE7lstat_h
;CHECK: _ZZ3gooE7lstat_h:
;CHECK: .long 0 # 0x0
;CHECK: .section my_bss.1,"bw"
;CHECK: .p2align 2, 0x0 # @_ZL1g
;CHECK: _ZL1g:
;CHECK: .zero 8
;CHECK: .section my_data.2,"dw"
;CHECK: .globl l # @l
;CHECK: .p2align 2, 0x0
;CHECK: l:
;CHECK: .long 5 # 0x5
;CHECK: .section my_rodata.2,"dr"
;CHECK: .globl m # @m
;CHECK: .p2align 2, 0x0
;CHECK: m:
;CHECK: .long 6 # 0x6
;CHECK: .bss
;CHECK: .globl n # @n
;CHECK: .p2align 2, 0x0
;CHECK: n:
;CHECK: .long 0 # 0x0
;CHECK: .data
;CHECK: .globl o # @o
;CHECK: .p2align 2, 0x0
;CHECK: o:
;CHECK: .long 6 # 0x6
;CHECK: .section .rdata,"dr"
;CHECK: .globl p # @p
;CHECK: .p2align 2, 0x0
;CHECK: p:
;CHECK: .long 7 # 0x7
|