Home | History | Annotate | Download | only in SystemZ
      1 # RUN: llvm-mc < %s -triple=s390x-linux-gnu -filetype=obj | llvm-dwarfdump - | FileCheck %s
      2 #
      3 # We use both R_390_32 and R_390_64 to encode the dwarf information.
      4 # Test that they are used correctly.  This uses the assembly output
      5 # for variable-loc.ll
      6 #
      7 # A couple of R_390_32s, both at 0 and elsewhere:
      8 #
      9 # CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000000] = "clang version 3.2 ")
     10 # CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000013] = "simple.c")
     11 #
     12 # A couple of R_390_64s similarly:
     13 #
     14 # CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
     15 # CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000000000050)
     16 
     17 
     18 	.file	"test/DebugInfo/SystemZ/variable-loc.ll"
     19 	.section	.debug_info,"",@progbits
     20 .Lsection_info:
     21 	.section	.debug_abbrev,"",@progbits
     22 .Lsection_abbrev:
     23 	.section	.debug_aranges,"",@progbits
     24 	.section	.debug_macinfo,"",@progbits
     25 	.section	.debug_line,"",@progbits
     26 .Lsection_line:
     27 	.section	.debug_loc,"",@progbits
     28 	.section	.debug_pubtypes,"",@progbits
     29 	.section	.debug_str,"MS",@progbits,1
     30 .Linfo_string:
     31 	.section	.debug_ranges,"",@progbits
     32 .Ldebug_range:
     33 	.section	.debug_loc,"",@progbits
     34 .Lsection_debug_loc:
     35 	.text
     36 .Ltext_begin:
     37 	.data
     38 	.file	1 "simple.c"
     39 	.file	2 "<stdin>"
     40 	.text
     41 	.globl	main
     42 	.align	4
     43 	.type	main,@function
     44 main:                                   # @main
     45 	.cfi_startproc
     46 .Lfunc_begin0:
     47 	.loc	2 18 0                  # :18:0
     48 # BB#0:                                 # %entry
     49 	stmg	%r12, %r15, 96(%r15)
     50 .Ltmp2:
     51 	.cfi_offset %r12, -64
     52 .Ltmp3:
     53 	.cfi_offset %r13, -56
     54 .Ltmp4:
     55 	.cfi_offset %r14, -48
     56 .Ltmp5:
     57 	.cfi_offset %r15, -40
     58 	aghi	%r15, -568
     59 .Ltmp6:
     60 	.cfi_def_cfa_offset 728
     61 	mvhi	564(%r15), 0
     62 	la	%r13, 164(%r15)
     63 	lhi	%r12, 100
     64 	.loc	2 22 3 prologue_end     # :22:3
     65 .Ltmp7:
     66 	lgr	%r2, %r13
     67 	lr	%r3, %r12
     68 	brasl	%r14, populate_array@PLT
     69 	.loc	2 23 9                  # :23:9
     70 	lgr	%r2, %r13
     71 	lr	%r3, %r12
     72 	brasl	%r14, sum_array@PLT
     73 	lr	%r0, %r2
     74 	st	%r0, 160(%r15)
     75 	.loc	2 24 3                  # :24:3
     76 	larl	%r2, .L.str
     77 	lr	%r3, %r0
     78 	brasl	%r14, printf@PLT
     79 	lhi	%r2, 0
     80 	.loc	2 26 3                  # :26:3
     81 	lmg	%r12, %r15, 664(%r15)
     82 	br	%r14
     83 .Ltmp8:
     84 .Ltmp9:
     85 	.size	main, .Ltmp9-main
     86 .Lfunc_end0:
     87 	.cfi_endproc
     88 
     89 	.type	.L.str,@object          # @.str
     90 	.section	.rodata.str1.2,"aMS",@progbits,1
     91 	.align	2
     92 .L.str:
     93 	.asciz	 "Total is %d\n"
     94 	.size	.L.str, 13
     95 
     96 	.cfi_sections .debug_frame
     97 	.text
     98 .Ltext_end:
     99 	.data
    100 .Ldata_end:
    101 	.text
    102 .Lsection_end1:
    103 	.section	.debug_info,"",@progbits
    104 .L.debug_info_begin0:
    105 	.long	155                     # Length of Compilation Unit Info
    106 	.short	2                       # DWARF version number
    107 	.long	.L.debug_abbrev_begin   # Offset Into Abbrev. Section
    108 	.byte	8                       # Address Size (in bytes)
    109 	.byte	1                       # Abbrev [1] 0xb:0x94 DW_TAG_compile_unit
    110 	.long	.Linfo_string0          # DW_AT_producer
    111 	.short	12                      # DW_AT_language
    112 	.long	.Linfo_string1          # DW_AT_name
    113 	.quad	0                       # DW_AT_low_pc
    114 	.long	.Lsection_line          # DW_AT_stmt_list
    115 	.long	.Linfo_string2          # DW_AT_comp_dir
    116 	.byte	2                       # Abbrev [2] 0x26:0x7 DW_TAG_subprogram
    117 	.long	.Linfo_string3          # DW_AT_name
    118 	.byte	2                       # DW_AT_decl_file
    119 	.byte	4                       # DW_AT_decl_line
    120                                         # DW_AT_prototyped
    121                                         # DW_AT_external
    122 	.byte	3                       # Abbrev [3] 0x2d:0xb DW_TAG_subprogram
    123 	.long	.Linfo_string4          # DW_AT_name
    124 	.byte	2                       # DW_AT_decl_file
    125 	.byte	9                       # DW_AT_decl_line
    126                                         # DW_AT_prototyped
    127 	.long	56                      # DW_AT_type
    128                                         # DW_AT_external
    129 	.byte	4                       # Abbrev [4] 0x38:0x7 DW_TAG_base_type
    130 	.long	.Linfo_string5          # DW_AT_name
    131 	.byte	5                       # DW_AT_encoding
    132 	.byte	4                       # DW_AT_byte_size
    133 	.byte	5                       # Abbrev [5] 0x3f:0xb DW_TAG_subprogram
    134 	.long	.Linfo_string6          # DW_AT_name
    135 	.byte	2                       # DW_AT_decl_file
    136 	.byte	18                      # DW_AT_decl_line
    137                                         # DW_AT_prototyped
    138 	.long	56                      # DW_AT_type
    139                                         # DW_AT_external
    140                                         # DW_AT_declaration
    141 	.byte	6                       # Abbrev [6] 0x4a:0x7 DW_TAG_base_type
    142 	.long	.Linfo_string5          # DW_AT_name
    143 	.byte	4                       # DW_AT_byte_size
    144 	.byte	5                       # DW_AT_encoding
    145 	.byte	7                       # Abbrev [7] 0x51:0x5 DW_TAG_array_type
    146 	.long	56                      # DW_AT_type
    147 	.byte	8                       # Abbrev [8] 0x56:0x48 DW_TAG_subprogram
    148 	.long	63                      # DW_AT_specification
    149 	.quad	.Lfunc_begin0           # DW_AT_low_pc
    150 	.quad	.Lfunc_end0             # DW_AT_high_pc
    151 	.byte	1                       # DW_AT_frame_base
    152 	.byte	95
    153                                         # DW_AT_APPLE_omit_frame_ptr
    154 	.byte	9                       # Abbrev [9] 0x6d:0x30 DW_TAG_lexical_block
    155 	.quad	.Ltmp7                  # DW_AT_low_pc
    156 	.quad	.Ltmp8                  # DW_AT_high_pc
    157 	.byte	10                      # Abbrev [10] 0x7e:0xf DW_TAG_variable
    158 	.long	.Linfo_string7          # DW_AT_name
    159 	.byte	2                       # DW_AT_decl_file
    160 	.byte	19                      # DW_AT_decl_line
    161 	.long	81                      # DW_AT_type
    162 	.byte	3                       # DW_AT_location
    163 	.byte	145
    164 	.ascii	 "\244\001"
    165 	.byte	10                      # Abbrev [10] 0x8d:0xf DW_TAG_variable
    166 	.long	.Linfo_string8          # DW_AT_name
    167 	.byte	2                       # DW_AT_decl_file
    168 	.byte	20                      # DW_AT_decl_line
    169 	.long	56                      # DW_AT_type
    170 	.byte	3                       # DW_AT_location
    171 	.byte	145
    172 	.ascii	 "\240\001"
    173 	.byte	0                       # End Of Children Mark
    174 	.byte	0                       # End Of Children Mark
    175 	.byte	0                       # End Of Children Mark
    176 .L.debug_info_end0:
    177 	.section	.debug_abbrev,"",@progbits
    178 .L.debug_abbrev_begin:
    179 	.byte	1                       # Abbreviation Code
    180 	.byte	17                      # DW_TAG_compile_unit
    181 	.byte	1                       # DW_CHILDREN_yes
    182 	.byte	37                      # DW_AT_producer
    183 	.byte	14                      # DW_FORM_strp
    184 	.byte	19                      # DW_AT_language
    185 	.byte	5                       # DW_FORM_data2
    186 	.byte	3                       # DW_AT_name
    187 	.byte	14                      # DW_FORM_strp
    188 	.byte	17                      # DW_AT_low_pc
    189 	.byte	1                       # DW_FORM_addr
    190 	.byte	16                      # DW_AT_stmt_list
    191 	.byte	6                       # DW_FORM_data4
    192 	.byte	27                      # DW_AT_comp_dir
    193 	.byte	14                      # DW_FORM_strp
    194 	.byte	0                       # EOM(1)
    195 	.byte	0                       # EOM(2)
    196 	.byte	2                       # Abbreviation Code
    197 	.byte	46                      # DW_TAG_subprogram
    198 	.byte	0                       # DW_CHILDREN_no
    199 	.byte	3                       # DW_AT_name
    200 	.byte	14                      # DW_FORM_strp
    201 	.byte	58                      # DW_AT_decl_file
    202 	.byte	11                      # DW_FORM_data1
    203 	.byte	59                      # DW_AT_decl_line
    204 	.byte	11                      # DW_FORM_data1
    205 	.byte	39                      # DW_AT_prototyped
    206 	.byte	25                      # DW_FORM_flag_present
    207 	.byte	63                      # DW_AT_external
    208 	.byte	25                      # DW_FORM_flag_present
    209 	.byte	0                       # EOM(1)
    210 	.byte	0                       # EOM(2)
    211 	.byte	3                       # Abbreviation Code
    212 	.byte	46                      # DW_TAG_subprogram
    213 	.byte	0                       # DW_CHILDREN_no
    214 	.byte	3                       # DW_AT_name
    215 	.byte	14                      # DW_FORM_strp
    216 	.byte	58                      # DW_AT_decl_file
    217 	.byte	11                      # DW_FORM_data1
    218 	.byte	59                      # DW_AT_decl_line
    219 	.byte	11                      # DW_FORM_data1
    220 	.byte	39                      # DW_AT_prototyped
    221 	.byte	25                      # DW_FORM_flag_present
    222 	.byte	73                      # DW_AT_type
    223 	.byte	19                      # DW_FORM_ref4
    224 	.byte	63                      # DW_AT_external
    225 	.byte	25                      # DW_FORM_flag_present
    226 	.byte	0                       # EOM(1)
    227 	.byte	0                       # EOM(2)
    228 	.byte	4                       # Abbreviation Code
    229 	.byte	36                      # DW_TAG_base_type
    230 	.byte	0                       # DW_CHILDREN_no
    231 	.byte	3                       # DW_AT_name
    232 	.byte	14                      # DW_FORM_strp
    233 	.byte	62                      # DW_AT_encoding
    234 	.byte	11                      # DW_FORM_data1
    235 	.byte	11                      # DW_AT_byte_size
    236 	.byte	11                      # DW_FORM_data1
    237 	.byte	0                       # EOM(1)
    238 	.byte	0                       # EOM(2)
    239 	.byte	5                       # Abbreviation Code
    240 	.byte	46                      # DW_TAG_subprogram
    241 	.byte	0                       # DW_CHILDREN_no
    242 	.byte	3                       # DW_AT_name
    243 	.byte	14                      # DW_FORM_strp
    244 	.byte	58                      # DW_AT_decl_file
    245 	.byte	11                      # DW_FORM_data1
    246 	.byte	59                      # DW_AT_decl_line
    247 	.byte	11                      # DW_FORM_data1
    248 	.byte	39                      # DW_AT_prototyped
    249 	.byte	25                      # DW_FORM_flag_present
    250 	.byte	73                      # DW_AT_type
    251 	.byte	19                      # DW_FORM_ref4
    252 	.byte	63                      # DW_AT_external
    253 	.byte	25                      # DW_FORM_flag_present
    254 	.byte	60                      # DW_AT_declaration
    255 	.byte	25                      # DW_FORM_flag_present
    256 	.byte	0                       # EOM(1)
    257 	.byte	0                       # EOM(2)
    258 	.byte	6                       # Abbreviation Code
    259 	.byte	36                      # DW_TAG_base_type
    260 	.byte	0                       # DW_CHILDREN_no
    261 	.byte	3                       # DW_AT_name
    262 	.byte	14                      # DW_FORM_strp
    263 	.byte	11                      # DW_AT_byte_size
    264 	.byte	11                      # DW_FORM_data1
    265 	.byte	62                      # DW_AT_encoding
    266 	.byte	11                      # DW_FORM_data1
    267 	.byte	0                       # EOM(1)
    268 	.byte	0                       # EOM(2)
    269 	.byte	7                       # Abbreviation Code
    270 	.byte	1                       # DW_TAG_array_type
    271 	.byte	0                       # DW_CHILDREN_no
    272 	.byte	73                      # DW_AT_type
    273 	.byte	19                      # DW_FORM_ref4
    274 	.byte	0                       # EOM(1)
    275 	.byte	0                       # EOM(2)
    276 	.byte	8                       # Abbreviation Code
    277 	.byte	46                      # DW_TAG_subprogram
    278 	.byte	1                       # DW_CHILDREN_yes
    279 	.byte	71                      # DW_AT_specification
    280 	.byte	19                      # DW_FORM_ref4
    281 	.byte	17                      # DW_AT_low_pc
    282 	.byte	1                       # DW_FORM_addr
    283 	.byte	18                      # DW_AT_high_pc
    284 	.byte	1                       # DW_FORM_addr
    285 	.byte	64                      # DW_AT_frame_base
    286 	.byte	10                      # DW_FORM_block1
    287 	.ascii	 "\347\177"             # DW_AT_APPLE_omit_frame_ptr
    288 	.byte	25                      # DW_FORM_flag_present
    289 	.byte	0                       # EOM(1)
    290 	.byte	0                       # EOM(2)
    291 	.byte	9                       # Abbreviation Code
    292 	.byte	11                      # DW_TAG_lexical_block
    293 	.byte	1                       # DW_CHILDREN_yes
    294 	.byte	17                      # DW_AT_low_pc
    295 	.byte	1                       # DW_FORM_addr
    296 	.byte	18                      # DW_AT_high_pc
    297 	.byte	1                       # DW_FORM_addr
    298 	.byte	0                       # EOM(1)
    299 	.byte	0                       # EOM(2)
    300 	.byte	10                      # Abbreviation Code
    301 	.byte	52                      # DW_TAG_variable
    302 	.byte	0                       # DW_CHILDREN_no
    303 	.byte	3                       # DW_AT_name
    304 	.byte	14                      # DW_FORM_strp
    305 	.byte	58                      # DW_AT_decl_file
    306 	.byte	11                      # DW_FORM_data1
    307 	.byte	59                      # DW_AT_decl_line
    308 	.byte	11                      # DW_FORM_data1
    309 	.byte	73                      # DW_AT_type
    310 	.byte	19                      # DW_FORM_ref4
    311 	.byte	2                       # DW_AT_location
    312 	.byte	10                      # DW_FORM_block1
    313 	.byte	0                       # EOM(1)
    314 	.byte	0                       # EOM(2)
    315 	.byte	0                       # EOM(3)
    316 .L.debug_abbrev_end:
    317 	.section	.debug_aranges,"",@progbits
    318 	.section	.debug_ranges,"",@progbits
    319 	.section	.debug_macinfo,"",@progbits
    320 	.section	.debug_str,"MS",@progbits,1
    321 .Linfo_string0:
    322 	.asciz	 "clang version 3.2 "
    323 .Linfo_string1:
    324 	.asciz	 "simple.c"
    325 .Linfo_string2:
    326 	.asciz	 "/home/timnor01/a64-trunk/build"
    327 .Linfo_string3:
    328 	.asciz	 "populate_array"
    329 .Linfo_string4:
    330 	.asciz	 "sum_array"
    331 .Linfo_string5:
    332 	.asciz	 "int"
    333 .Linfo_string6:
    334 	.asciz	 "main"
    335 .Linfo_string7:
    336 	.asciz	 "main_arr"
    337 .Linfo_string8:
    338 	.asciz	 "val"
    339 
    340 	.section	".note.GNU-stack","",@progbits
    341