2015-06-27 23:11:43 +02:00
|
|
|
; RUN: llc -mtriple aarch64_be-gnu-linux -O0 -filetype=obj -o %t_be.o %s
|
2017-09-12 01:05:20 +02:00
|
|
|
; RUN: llvm-dwarfdump -v -debug-info %t_be.o | FileCheck %s
|
2015-06-26 01:38:22 +02:00
|
|
|
|
|
|
|
; Produced at -O0 from:
|
|
|
|
; struct bitfield {
|
|
|
|
; int a : 2;
|
|
|
|
; int b : 32;
|
|
|
|
; int c : 1;
|
|
|
|
; int d : 28;
|
|
|
|
; };
|
|
|
|
; struct bitfield b;
|
|
|
|
|
|
|
|
; Note that DWARF 2 counts bit offsets backwards from the high end of
|
|
|
|
; the storage unit to the high end of the bit field.
|
|
|
|
|
|
|
|
; CHECK: DW_TAG_member
|
|
|
|
; CHECK-NEXT: DW_AT_name{{.*}}"a"
|
|
|
|
; CHECK-NOT: DW_TAG_member
|
|
|
|
; CHECK: DW_AT_byte_size {{.*}} (0x04)
|
|
|
|
; CHECK-NEXT: DW_AT_bit_size {{.*}} (0x02)
|
|
|
|
; CHECK-NEXT: DW_AT_bit_offset {{.*}} (0x00)
|
[dwarfdump] Pretty print location expressions and location lists
Summary:
Based on Fred's patch here: https://reviews.llvm.org/D6771
I can't seem to commandeer the old review, so I'm creating a new one.
With that change the locations exrpessions are pretty printed inline in the
DIE tree. The output looks like this for debug_loc entries:
DW_AT_location [DW_FORM_data4] (0x00000000
0x0000000000000001 - 0x000000000000000b: DW_OP_consts +3
0x000000000000000b - 0x0000000000000012: DW_OP_consts +7
0x0000000000000012 - 0x000000000000001b: DW_OP_reg0 RAX, DW_OP_piece 0x4
0x000000000000001b - 0x0000000000000024: DW_OP_breg5 RDI+0)
And like this for debug_loc.dwo entries:
DW_AT_location [DW_FORM_sec_offset] (0x00000000
Addr idx 2 (w/ length 190): DW_OP_consts +0, DW_OP_stack_value
Addr idx 3 (w/ length 23): DW_OP_reg0 RAX, DW_OP_piece 0x4)
Simple locations without ranges are printed inline:
DW_AT_location [DW_FORM_block1] (DW_OP_reg4 RSI, DW_OP_piece 0x4, DW_OP_bit_piece 0x20 0x0)
The debug_loc(.dwo) dumping in changed accordingly to factor the code.
Reviewers: dblaikie, aprantl, friss
Subscribers: mgorny, javed.absar, hiraditya, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D37123
llvm-svn: 312042
2017-08-29 23:41:21 +02:00
|
|
|
; CHECK-NEXT: DW_AT_data_member_location {{.*}} (DW_OP_plus_uconst 0x0)
|
2015-06-26 01:38:22 +02:00
|
|
|
|
|
|
|
; CHECK: DW_TAG_member
|
|
|
|
; CHECK-NEXT: DW_AT_name{{.*}}"b"
|
|
|
|
; CHECK-NOT: DW_TAG_member
|
[dwarfdump] Pretty print location expressions and location lists
Summary:
Based on Fred's patch here: https://reviews.llvm.org/D6771
I can't seem to commandeer the old review, so I'm creating a new one.
With that change the locations exrpessions are pretty printed inline in the
DIE tree. The output looks like this for debug_loc entries:
DW_AT_location [DW_FORM_data4] (0x00000000
0x0000000000000001 - 0x000000000000000b: DW_OP_consts +3
0x000000000000000b - 0x0000000000000012: DW_OP_consts +7
0x0000000000000012 - 0x000000000000001b: DW_OP_reg0 RAX, DW_OP_piece 0x4
0x000000000000001b - 0x0000000000000024: DW_OP_breg5 RDI+0)
And like this for debug_loc.dwo entries:
DW_AT_location [DW_FORM_sec_offset] (0x00000000
Addr idx 2 (w/ length 190): DW_OP_consts +0, DW_OP_stack_value
Addr idx 3 (w/ length 23): DW_OP_reg0 RAX, DW_OP_piece 0x4)
Simple locations without ranges are printed inline:
DW_AT_location [DW_FORM_block1] (DW_OP_reg4 RSI, DW_OP_piece 0x4, DW_OP_bit_piece 0x20 0x0)
The debug_loc(.dwo) dumping in changed accordingly to factor the code.
Reviewers: dblaikie, aprantl, friss
Subscribers: mgorny, javed.absar, hiraditya, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D37123
llvm-svn: 312042
2017-08-29 23:41:21 +02:00
|
|
|
; CHECK: DW_AT_data_member_location {{.*}} (DW_OP_plus_uconst 0x4)
|
2015-06-26 01:38:22 +02:00
|
|
|
|
|
|
|
; CHECK: DW_TAG_member
|
|
|
|
; CHECK-NEXT: DW_AT_name{{.*}}"c"
|
|
|
|
; CHECK-NOT: DW_TAG_member
|
|
|
|
; CHECK: DW_AT_byte_size {{.*}} (0x04)
|
|
|
|
; CHECK-NEXT: DW_AT_bit_size {{.*}} (0x01)
|
|
|
|
; CHECK-NEXT: DW_AT_bit_offset {{.*}} (0x00)
|
[dwarfdump] Pretty print location expressions and location lists
Summary:
Based on Fred's patch here: https://reviews.llvm.org/D6771
I can't seem to commandeer the old review, so I'm creating a new one.
With that change the locations exrpessions are pretty printed inline in the
DIE tree. The output looks like this for debug_loc entries:
DW_AT_location [DW_FORM_data4] (0x00000000
0x0000000000000001 - 0x000000000000000b: DW_OP_consts +3
0x000000000000000b - 0x0000000000000012: DW_OP_consts +7
0x0000000000000012 - 0x000000000000001b: DW_OP_reg0 RAX, DW_OP_piece 0x4
0x000000000000001b - 0x0000000000000024: DW_OP_breg5 RDI+0)
And like this for debug_loc.dwo entries:
DW_AT_location [DW_FORM_sec_offset] (0x00000000
Addr idx 2 (w/ length 190): DW_OP_consts +0, DW_OP_stack_value
Addr idx 3 (w/ length 23): DW_OP_reg0 RAX, DW_OP_piece 0x4)
Simple locations without ranges are printed inline:
DW_AT_location [DW_FORM_block1] (DW_OP_reg4 RSI, DW_OP_piece 0x4, DW_OP_bit_piece 0x20 0x0)
The debug_loc(.dwo) dumping in changed accordingly to factor the code.
Reviewers: dblaikie, aprantl, friss
Subscribers: mgorny, javed.absar, hiraditya, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D37123
llvm-svn: 312042
2017-08-29 23:41:21 +02:00
|
|
|
; CHECK: DW_AT_data_member_location {{.*}} (DW_OP_plus_uconst 0x8)
|
2015-06-26 01:38:22 +02:00
|
|
|
|
|
|
|
; CHECK: DW_TAG_member
|
|
|
|
; CHECK-NEXT: DW_AT_name{{.*}}"d"
|
|
|
|
; CHECK-NOT: DW_TAG_member
|
|
|
|
; CHECK: DW_AT_byte_size {{.*}} (0x04)
|
|
|
|
; CHECK-NEXT: DW_AT_bit_size {{.*}} (0x1c)
|
|
|
|
; CHECK-NEXT: DW_AT_bit_offset {{.*}} (0x01)
|
[dwarfdump] Pretty print location expressions and location lists
Summary:
Based on Fred's patch here: https://reviews.llvm.org/D6771
I can't seem to commandeer the old review, so I'm creating a new one.
With that change the locations exrpessions are pretty printed inline in the
DIE tree. The output looks like this for debug_loc entries:
DW_AT_location [DW_FORM_data4] (0x00000000
0x0000000000000001 - 0x000000000000000b: DW_OP_consts +3
0x000000000000000b - 0x0000000000000012: DW_OP_consts +7
0x0000000000000012 - 0x000000000000001b: DW_OP_reg0 RAX, DW_OP_piece 0x4
0x000000000000001b - 0x0000000000000024: DW_OP_breg5 RDI+0)
And like this for debug_loc.dwo entries:
DW_AT_location [DW_FORM_sec_offset] (0x00000000
Addr idx 2 (w/ length 190): DW_OP_consts +0, DW_OP_stack_value
Addr idx 3 (w/ length 23): DW_OP_reg0 RAX, DW_OP_piece 0x4)
Simple locations without ranges are printed inline:
DW_AT_location [DW_FORM_block1] (DW_OP_reg4 RSI, DW_OP_piece 0x4, DW_OP_bit_piece 0x20 0x0)
The debug_loc(.dwo) dumping in changed accordingly to factor the code.
Reviewers: dblaikie, aprantl, friss
Subscribers: mgorny, javed.absar, hiraditya, llvm-commits, JDevlieghere
Differential Revision: https://reviews.llvm.org/D37123
llvm-svn: 312042
2017-08-29 23:41:21 +02:00
|
|
|
; CHECK-NEXT: DW_AT_data_member_location {{.*}} (DW_OP_plus_uconst 0x8)
|
2015-06-26 01:38:22 +02:00
|
|
|
|
|
|
|
; ModuleID = 'bitfields.c'
|
2016-12-22 01:45:21 +01:00
|
|
|
source_filename = "test/DebugInfo/AArch64/bitfields.ll"
|
2015-06-26 01:38:22 +02:00
|
|
|
target datalayout = "E-m:e-i64:64-i128:128-n32:64-S128"
|
|
|
|
target triple = "aarch64_be--linux-gnu"
|
|
|
|
|
|
|
|
%struct.bitfield = type <{ i8, [3 x i8], i64 }>
|
|
|
|
|
2016-12-22 01:45:21 +01:00
|
|
|
@b = common global %struct.bitfield zeroinitializer, align 4, !dbg !0
|
2015-06-26 01:38:22 +02:00
|
|
|
|
2016-12-22 01:45:21 +01:00
|
|
|
!llvm.dbg.cu = !{!2}
|
2015-06-26 01:38:22 +02:00
|
|
|
!llvm.module.flags = !{!13, !14, !15}
|
|
|
|
!llvm.ident = !{!16}
|
|
|
|
|
2017-08-30 20:06:51 +02:00
|
|
|
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
|
2016-12-22 01:45:21 +01:00
|
|
|
!1 = !DIGlobalVariable(name: "b", scope: !2, file: !3, line: 8, type: !6, isLocal: false, isDefinition: true)
|
|
|
|
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !5, imports: !4)
|
|
|
|
!3 = !DIFile(filename: "bitfields.c", directory: "/")
|
|
|
|
!4 = !{}
|
|
|
|
!5 = !{!0}
|
|
|
|
!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "bitfield", file: !3, line: 1, size: 96, elements: !7)
|
2015-06-26 01:38:22 +02:00
|
|
|
!7 = !{!8, !10, !11, !12}
|
2016-12-22 01:45:21 +01:00
|
|
|
!8 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !6, file: !3, line: 2, baseType: !9, size: 2)
|
2016-10-20 02:13:12 +02:00
|
|
|
!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
2016-12-22 01:45:21 +01:00
|
|
|
!10 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !6, file: !3, line: 3, baseType: !9, size: 32, offset: 32)
|
|
|
|
!11 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !6, file: !3, line: 4, baseType: !9, size: 1, offset: 64)
|
|
|
|
!12 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !6, file: !3, line: 5, baseType: !9, size: 28, offset: 65)
|
2015-06-26 01:38:22 +02:00
|
|
|
!13 = !{i32 2, !"Dwarf Version", i32 2}
|
|
|
|
!14 = !{i32 2, !"Debug Info Version", i32 3}
|
|
|
|
!15 = !{i32 1, !"PIC Level", i32 2}
|
|
|
|
!16 = !{!"clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)"}
|
2016-12-22 01:45:21 +01:00
|
|
|
|