[llvm] 64363a9 - [NVPTX]Add a test for debug info for packed bitfields, NFC.

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 06:12:34 PDT 2020


Author: Alexey Bataev
Date: 2020-07-08T09:10:42-04:00
New Revision: 64363a9d93006595d05825ce8fdbcc146aac15b1

URL: https://github.com/llvm/llvm-project/commit/64363a9d93006595d05825ce8fdbcc146aac15b1
DIFF: https://github.com/llvm/llvm-project/commit/64363a9d93006595d05825ce8fdbcc146aac15b1.diff

LOG: [NVPTX]Add a test for debug info for packed bitfields, NFC.

Added: 
    llvm/test/DebugInfo/NVPTX/packed_bitfields.ll

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/DebugInfo/NVPTX/packed_bitfields.ll b/llvm/test/DebugInfo/NVPTX/packed_bitfields.ll
new file mode 100644
index 000000000000..36433064fa92
--- /dev/null
+++ b/llvm/test/DebugInfo/NVPTX/packed_bitfields.ll
@@ -0,0 +1,42 @@
+; RUN: llc < %s -mtriple=nvptx64-nvidia-cuda | FileCheck %s
+
+; Produced at -O0 from:
+; struct {
+;   char : 3;
+;   char a : 6;
+; } __attribute__((__packed__)) 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: .section .debug_info
+; CHECK:      .b8 3    // Abbrev {{.*}} DW_TAG_structure_type
+; CHECK:      .b8 3    // DW_AT_decl_line
+; CHECK-NEXT: .b8 1    // DW_AT_byte_size
+; CHECK-NEXT: .b8 6    // DW_AT_bit_size
+; CHECK-NEXT: .b64 -1  // DW_AT_bit_offset
+; CHECK-NEXT: .b8 2    // DW_AT_data_member_location
+
+%struct.anon = type { i16 }
+
+ at b = global %struct.anon zeroinitializer, align 1, !dbg !0
+
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!10, !11, !12, !13}
+!llvm.ident = !{!14}
+
+!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
+!1 = distinct !DIGlobalVariable(name: "b", scope: !2, file: !3, line: 4, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 11.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: None, sysroot: "/")
+!3 = !DIFile(filename: "repro.c", directory: "/tmp")
+!4 = !{}
+!5 = !{!0}
+!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !3, line: 1, size: 16, elements: !7)
+!7 = !{!8}
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !6, file: !3, line: 3, baseType: !9, size: 6, offset: 3, flags: DIFlagBitField, extraData: i64 0)
+!9 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
+!10 = !{i32 7, !"Dwarf Version", i32 2}
+!11 = !{i32 2, !"Debug Info Version", i32 3}
+!12 = !{i32 1, !"wchar_size", i32 4}
+!13 = !{i32 7, !"PIC Level", i32 2}
+!14 = !{!"clang version 11.0.0 "}


        


More information about the llvm-commits mailing list