Adrian Prantl | f393d31 | 2016-04-28 15:37:48 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple x86_64-apple-macosx -O0 -filetype=obj -o - %s \ |
| 2 | ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s |
| 3 | ; |
| 4 | ; Generated from: |
| 5 | ; #include <stdint.h> |
| 6 | ; #pragma pack(1) |
| 7 | ; struct PackedBits |
| 8 | ; { |
| 9 | ; char a; |
| 10 | ; uint32_t b : 5, |
| 11 | ; c : 27 |
| 12 | ; } s; |
| 13 | ; #pragma pack() |
| 14 | |
| 15 | source_filename = "bitfield.c" |
| 16 | target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" |
| 17 | target triple = "x86_64-apple-macosx" |
| 18 | |
| 19 | %struct.PackedBits = type <{ i8, i32 }> |
| 20 | |
| 21 | @s = common global %struct.PackedBits zeroinitializer, align 1 |
| 22 | |
| 23 | !llvm.dbg.cu = !{!0} |
| 24 | !llvm.module.flags = !{!14, !15, !16} |
| 25 | !llvm.ident = !{!17} |
| 26 | |
| 27 | !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 267633)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3) |
| 28 | !1 = !DIFile(filename: "bitfield.c", directory: "/Volumes/Data/llvm") |
| 29 | !2 = !{} |
| 30 | !3 = !{!4} |
| 31 | !4 = distinct !DIGlobalVariable(name: "s", scope: !0, file: !1, line: 8, type: !5, isLocal: false, isDefinition: true, variable: %struct.PackedBits* @s) |
| 32 | !5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "PackedBits", file: !1, line: 3, size: 40, align: 8, elements: !6) |
| 33 | !6 = !{!7, !9, !13} |
| 34 | |
| 35 | ; CHECK: DW_TAG_member |
| 36 | ; CHECK-NEXT: DW_AT_name{{.*}}"a" |
| 37 | ; CHECK-NOT: DW_TAG |
| 38 | ; CHECK-NOT: DW_AT_bit_offset |
| 39 | ; CHECK-NOT: DW_AT_data_bit_offset |
| 40 | ; CHECK: DW_AT_data_member_location [DW_FORM_data1] (0x00) |
| 41 | !7 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !5, file: !1, line: 5, baseType: !8, size: 8, align: 8) |
| 42 | |
| 43 | !8 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) |
| 44 | |
| 45 | ; CHECK: DW_TAG_member |
| 46 | ; CHECK-NEXT: DW_AT_name{{.*}}"b" |
| 47 | ; CHECK-NOT: DW_TAG |
| 48 | ; CHECK-NOT: DW_AT_bit_offset |
| 49 | ; CHECK: DW_AT_data_bit_offset [DW_FORM_data1] (0x08) |
| 50 | ; CHECK-NEXT: DW_AT_data_member_location [DW_FORM_data1] (0x00) |
| 51 | !9 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !5, file: !1, line: 6, baseType: !10, size: 5, align: 32, offset: 8) |
| 52 | |
| 53 | !10 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint32_t", file: !11, line: 183, baseType: !12) |
| 54 | !11 = !DIFile(filename: "/Volumes/Data/llvm/_build.ninja.release/bin/../lib/clang/3.9.0/include/stdint.h", directory: "/Volumes/Data/llvm") |
| 55 | !12 = !DIBasicType(name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) |
| 56 | |
| 57 | ; CHECK: DW_TAG_member |
| 58 | ; CHECK-NEXT: DW_AT_name{{.*}}"c" |
| 59 | ; CHECK-NOT: DW_TAG |
| 60 | ; CHECK-NOT: DW_AT_bit_offset |
| 61 | ; CHECK: DW_AT_data_bit_offset [DW_FORM_data1] (0x0d) |
| 62 | ; CHECK-NEXT: DW_AT_data_member_location [DW_FORM_data1] (0x00) |
| 63 | !13 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !5, file: !1, line: 7, baseType: !10, size: 27, align: 32, offset: 13) |
| 64 | |
| 65 | !14 = !{i32 2, !"Dwarf Version", i32 4} |
| 66 | !15 = !{i32 2, !"Debug Info Version", i32 3} |
| 67 | !16 = !{i32 1, !"PIC Level", i32 2} |
| 68 | !17 = !{!"clang version 3.9.0 (trunk 267633)"} |