1 ; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=small -o %t
2 ; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=SMALL
3 ; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=medium -o %t
4 ; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=LARGE
5 ; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=medium -large-data-threshold=79 -o %t
6 ; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=LARGE
7 ; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=medium -large-data-threshold=80 -o %t
8 ; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=SMALL
9 ; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=large -large-data-threshold=79 -o %t
10 ; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=LARGE
11 ; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=large -large-data-threshold=80 -o %t
12 ; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=SMALL
14 ; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=small -data-sections -o %t
15 ; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=SMALL-DS
16 ; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=medium -data-sections -o %t
17 ; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=LARGE-DS
18 ; RUN: llc < %s -relocation-model=pic -filetype=obj -code-model=large -data-sections -o %t
19 ; RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=LARGE-DS
21 ; SMALL: .data {{.*}} WA {{.*}}
22 ; SMALL: .data.x {{.*}} WA {{.*}}
23 ; SMALL: .data0 {{.*}} WA {{.*}}
24 ; SMALL: .ldata {{.*}} WAl {{.*}}
25 ; SMALL: .ldata.x {{.*}} WAl {{.*}}
26 ; SMALL: .ldata0 {{.*}} WA {{.*}}
27 ; SMALL: force_small {{.*}} WA {{.*}}
28 ; SMALL: force_large {{.*}} WAl {{.*}}
29 ; SMALL: foo {{.*}} WA {{.*}}
30 ; SMALL: .bss {{.*}} WA {{.*}}
31 ; SMALL: .lbss {{.*}} WAl {{.*}}
32 ; SMALL: .rodata {{.*}} A {{.*}}
33 ; SMALL: .lrodata {{.*}} Al {{.*}}
34 ; SMALL: .data.rel.ro {{.*}} WA {{.*}}
35 ; SMALL: .tbss {{.*}} WAT {{.*}}
36 ; SMALL: .tdata {{.*}} WAT {{.*}}
38 ; SMALL-DS: .data {{.*}} WA {{.*}}
39 ; SMALL-DS: .data.x {{.*}} WA {{.*}}
40 ; SMALL-DS: .data0 {{.*}} WA {{.*}}
41 ; SMALL-DS: .ldata {{.*}} WAl {{.*}}
42 ; SMALL-DS: .ldata.x {{.*}} WAl {{.*}}
43 ; SMALL-DS: .ldata0 {{.*}} WA {{.*}}
44 ; SMALL-DS: .data.data {{.*}} WA {{.*}}
45 ; SMALL-DS: force_small {{.*}} WA {{.*}}
46 ; SMALL-DS: force_large {{.*}} WAl {{.*}}
47 ; SMALL-DS: foo {{.*}} WA {{.*}}
48 ; SMALL-DS: .lbss {{.*}} WAl {{.*}}
49 ; SMALL-DS: .bss.bss {{.*}} WA {{.*}}
50 ; SMALL-DS: .lrodata {{.*}} Al {{.*}}
51 ; SMALL-DS: .rodata.rodata {{.*}} A {{.*}}
52 ; SMALL-DS: .data.rel.ro.relro {{.*}} WA {{.*}}
53 ; SMALL-DS: .tbss.tbss {{.*}} WAT {{.*}}
54 ; SMALL-DS: .tdata.tdata {{.*}} WAT {{.*}}
56 ; LARGE: .data {{.*}} WA {{.*}}
57 ; LARGE: .data.x {{.*}} WA {{.*}}
58 ; LARGE: .data0 {{.*}} WA {{.*}}
59 ; LARGE: .ldata {{.*}} WAl {{.*}}
60 ; LARGE: .ldata.x {{.*}} WAl {{.*}}
61 ; LARGE: .ldata0 {{.*}} WA {{.*}}
62 ; LARGE: force_small {{.*}} WA {{.*}}
63 ; LARGE: force_large {{.*}} WAl {{.*}}
64 ; LARGE: foo {{.*}} WA {{.*}}
65 ; LARGE: .bss {{.*}} WA {{.*}}
66 ; LARGE: .lbss {{.*}} WAl {{.*}}
67 ; LARGE: .rodata {{.*}} A {{.*}}
68 ; LARGE: .lrodata {{.*}} Al {{.*}}
69 ; LARGE: .ldata.rel.ro {{.*}} WAl {{.*}}
70 ; LARGE: .tbss {{.*}} WAT {{.*}}
71 ; LARGE: .tdata {{.*}} WAT {{.*}}
73 ; LARGE-DS: .data {{.*}} WA {{.*}}
74 ; LARGE-DS: .data.x {{.*}} WA {{.*}}
75 ; LARGE-DS: .data0 {{.*}} WA {{.*}}
76 ; LARGE-DS: .ldata {{.*}} WAl {{.*}}
77 ; LARGE-DS: .ldata.x {{.*}} WAl {{.*}}
78 ; LARGE-DS: .ldata0 {{.*}} WA {{.*}}
79 ; LARGE-DS: .ldata.data {{.*}} WAl {{.*}}
80 ; LARGE-DS: force_small {{.*}} WA {{.*}}
81 ; LARGE-DS: force_large {{.*}} WAl {{.*}}
82 ; LARGE-DS: foo {{.*}} WA {{.*}}
83 ; LARGE-DS: .bss {{.*}} WA {{.*}}
84 ; LARGE-DS: .lbss.bss {{.*}} WAl {{.*}}
85 ; LARGE-DS: .rodata {{.*}} A {{.*}}
86 ; LARGE-DS: .lrodata.rodata {{.*}} Al {{.*}}
87 ; LARGE-DS: .ldata.rel.ro.relro {{.*}} WAl {{.*}}
88 ; LARGE-DS: .tbss.tbss {{.*}} WAT {{.*}}
89 ; LARGE-DS: .tdata.tdata {{.*}} WAT {{.*}}
91 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
92 target triple = "x86_64--linux"
94 @data_with_explicit_section = internal global [10 x i64] [i64 1, i64 2, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0], section ".data"
95 @data_with_explicit_section2 = internal global [10 x i64] [i64 1, i64 2, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0], section ".data.x"
96 @data_with_explicit_section0 = internal global [10 x i64] [i64 1, i64 2, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0], section ".data0"
97 @ldata_with_explicit_section = internal global [10 x i64] [i64 1, i64 2, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0], section ".ldata"
98 @ldata_with_explicit_section2 = internal global [10 x i64] [i64 1, i64 2, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0], section ".ldata.x"
99 @ldata_with_explicit_section0 = internal global [10 x i64] [i64 1, i64 2, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0], section ".ldata0"
100 @data = internal global [10 x i64] [i64 1, i64 2, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0]
101 @data_force_small = internal global [10 x i64] [i64 1, i64 2, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0], code_model "small", section "force_small"
102 @data_force_large = internal global [10 x i64] [i64 1, i64 2, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0], code_model "large", section "force_large"
103 @data_force_small_ldata = internal global [10 x i64] [i64 1, i64 2, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0], code_model "small", section ".ldata"
104 @data_force_large_data = internal global [10 x i64] [i64 1, i64 2, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0], code_model "large", section ".data"
105 @foo_with_explicit_section = internal global [10 x i64] [i64 1, i64 2, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0], section "foo"
106 @bss_with_explicit_section = internal global [10 x i64] zeroinitializer, section ".bss"
107 @lbss_with_explicit_section = internal global [10 x i64] zeroinitializer, section ".lbss"
108 @bss = internal global [10 x i64] zeroinitializer
109 @rodata_with_explicit_section = internal constant [10 x i64] zeroinitializer, section ".rodata"
110 @lrodata_with_explicit_section = internal constant [10 x i64] zeroinitializer, section ".lrodata"
111 @rodata = internal constant [10 x i64] zeroinitializer
112 @relro = internal constant [10 x ptr] [ptr @func, ptr @func, ptr @func, ptr @func, ptr @func, ptr @func, ptr @func, ptr @func, ptr @func, ptr @func]
113 @tbss = internal thread_local global [10 x i64] zeroinitializer
114 @tdata = internal thread_local global [10 x i64] [i64 1, i64 2, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0, i64 0]