1 ; RUN: llc -mtriple aarch64_be-gnu-linux -O0 -filetype=obj -o %t_be.o %s
2 ; RUN: llvm-dwarfdump -debug-dump=info %t_be.o | FileCheck %s
4 ; Produced at -O0 from:
13 ; Note that DWARF 2 counts bit offsets backwards from the high end of
14 ; the storage unit to the high end of the bit field.
16 ; CHECK: DW_TAG_member
17 ; CHECK-NEXT: DW_AT_name{{.*}}"a"
18 ; CHECK-NOT: DW_TAG_member
19 ; CHECK: DW_AT_byte_size {{.*}} (0x04)
20 ; CHECK-NEXT: DW_AT_bit_size {{.*}} (0x02)
21 ; CHECK-NEXT: DW_AT_bit_offset {{.*}} (0x00)
22 ; CHECK-NEXT: DW_AT_data_member_location {{.*}} 00
24 ; CHECK: DW_TAG_member
25 ; CHECK-NEXT: DW_AT_name{{.*}}"b"
26 ; CHECK-NOT: DW_TAG_member
27 ; CHECK: DW_AT_data_member_location {{.*}} 04
29 ; CHECK: DW_TAG_member
30 ; CHECK-NEXT: DW_AT_name{{.*}}"c"
31 ; CHECK-NOT: DW_TAG_member
32 ; CHECK: DW_AT_byte_size {{.*}} (0x04)
33 ; CHECK-NEXT: DW_AT_bit_size {{.*}} (0x01)
34 ; CHECK-NEXT: DW_AT_bit_offset {{.*}} (0x00)
35 ; CHECK-NEXT: DW_AT_data_member_location {{.*}} 08
37 ; CHECK: DW_TAG_member
38 ; CHECK-NEXT: DW_AT_name{{.*}}"d"
39 ; CHECK-NOT: DW_TAG_member
40 ; CHECK: DW_AT_byte_size {{.*}} (0x04)
41 ; CHECK-NEXT: DW_AT_bit_size {{.*}} (0x1c)
42 ; CHECK-NEXT: DW_AT_bit_offset {{.*}} (0x01)
43 ; CHECK-NEXT: DW_AT_data_member_location {{.*}} 08
45 ; ModuleID = 'bitfields.c'
46 target datalayout = "E-m:e-i64:64-i128:128-n32:64-S128"
47 target triple = "aarch64_be--linux-gnu"
49 %struct.bitfield = type <{ i8, [3 x i8], i64 }>
51 @b = common global %struct.bitfield zeroinitializer, align 4, !dbg !4
54 !llvm.module.flags = !{!13, !14, !15}
57 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2)
58 !1 = !DIFile(filename: "bitfields.c", directory: "/")
61 !4 = !DIGlobalVariable(name: "b", scope: !0, file: !5, line: 8, type: !6, isLocal: false, isDefinition: true)
62 !5 = !DIFile(filename: "bitfields.c", directory: "/")
63 !6 = !DICompositeType(tag: DW_TAG_structure_type, name: "bitfield", file: !5, line: 1, size: 96, elements: !7)
64 !7 = !{!8, !10, !11, !12}
65 !8 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !6, file: !5, line: 2, baseType: !9, size: 2)
66 !9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
67 !10 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !6, file: !5, line: 3, baseType: !9, size: 32, offset: 32)
68 !11 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !6, file: !5, line: 4, baseType: !9, size: 1, offset: 64)
69 !12 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !6, file: !5, line: 5, baseType: !9, size: 28, offset: 65)
70 !13 = !{i32 2, !"Dwarf Version", i32 2}
71 !14 = !{i32 2, !"Debug Info Version", i32 3}
72 !15 = !{i32 1, !"PIC Level", i32 2}
73 !16 = !{!"clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)"}