brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.7 KiB · b79c84d Raw
124 lines · plain
1; RUN: llc -mtriple=x86_64-unknown-linux-gnu %s -o %t -filetype=obj2; RUN: llvm-dwarfdump --debug-info %t | FileCheck %s3 4%struct.struct_t = type { i8 }5 6@g = dso_local global %struct.struct_t zeroinitializer, align 1, !dbg !07 8; CHECK-LABEL: DW_TAG_subprogram9; CHECK: DW_AT_name ("test1")10; CHECK: DW_TAG_variable11; CHECK: DW_AT_location (DW_OP_fbreg -1, DW_OP_deref_size 0x1, DW_OP_constu 0x7, DW_OP_and, DW_OP_stack_value)12; CHECK: DW_AT_name ("x")13; CHECK: DW_TAG_variable14; CHECK: DW_AT_location (DW_OP_fbreg -1, DW_OP_deref_size 0x1, DW_OP_constu 0x39, DW_OP_shl, DW_OP_constu 0x3c, DW_OP_shra, DW_OP_stack_value)15; CHECK: DW_AT_name ("y")16 17define i32 @test1() !dbg !13 {18entry:19  %0 = alloca %struct.struct_t, align 120  tail call void @llvm.dbg.declare(metadata ptr %0, metadata !16, metadata !DIExpression(DW_OP_LLVM_extract_bits_zext, 0, 3)), !dbg !1721  tail call void @llvm.dbg.declare(metadata ptr %0, metadata !18, metadata !DIExpression(DW_OP_LLVM_extract_bits_sext, 3, 4)), !dbg !1722  ret i32 0, !dbg !1723}24 25; CHECK-LABEL: DW_TAG_subprogram26; CHECK: DW_AT_name ("test2")27; CHECK: DW_TAG_variable28; CHECK: DW_AT_location (DW_OP_breg0 {{R[^+]+}}+0, DW_OP_constu 0xff, DW_OP_and, DW_OP_constu 0x7, DW_OP_and, DW_OP_stack_value)29; CHECK: DW_AT_name ("x")30; CHECK: DW_TAG_variable31; CHECK: DW_AT_location (DW_OP_breg0 {{R[^+]+}}+0, DW_OP_constu 0xff, DW_OP_and, DW_OP_constu 0x39, DW_OP_shl, DW_OP_constu 0x3c, DW_OP_shra, DW_OP_stack_value)32; CHECK: DW_AT_name ("y")33 34define i8 @test2() !dbg !20 {35entry:36  %0 = load i8, ptr @g, align 137  tail call void @llvm.dbg.value(metadata i8 %0, metadata !21, metadata !DIExpression(DW_OP_LLVM_extract_bits_zext, 0, 3)), !dbg !2238  tail call void @llvm.dbg.value(metadata i8 %0, metadata !23, metadata !DIExpression(DW_OP_LLVM_extract_bits_sext, 3, 4)), !dbg !2239  ret i8 %0, !dbg !2240}41 42; CHECK-LABEL: DW_TAG_subprogram43; CHECK: DW_AT_name ("test3")44; CHECK: DW_TAG_variable45; CHECK: DW_AT_location (DW_OP_breg0 {{R[^+]+}}+0, DW_OP_constu 0x3f, DW_OP_shr, DW_OP_stack_value)46; CHECK: DW_AT_name ("x")47; CHECK: DW_TAG_variable48; CHECK: DW_AT_location (DW_OP_breg0 {{R[^+]+}}+0, DW_OP_constu 0x3f, DW_OP_shra, DW_OP_stack_value)49; CHECK: DW_AT_name ("y")50 51define i64 @test3(ptr %p) !dbg !24 {52entry:53  %0 = load i64, ptr %p, align 854  tail call void @llvm.dbg.value(metadata i64 %0, metadata !25, metadata !DIExpression(DW_OP_LLVM_extract_bits_zext, 63, 1)), !dbg !2655  tail call void @llvm.dbg.value(metadata i64 %0, metadata !27, metadata !DIExpression(DW_OP_LLVM_extract_bits_sext, 63, 1)), !dbg !2656  ret i64 %0, !dbg !2657}58 59; CHECK-LABEL: DW_TAG_subprogram60; CHECK: DW_AT_name ("test4")61; CHECK: DW_TAG_variable62; CHECK: DW_AT_location (DW_OP_fbreg -4, DW_OP_deref_size 0x4, DW_OP_constu 0x20, DW_OP_shl, DW_OP_constu 0x3f, DW_OP_shr, DW_OP_stack_value)63; CHECK: DW_AT_name ("x")64; CHECK: DW_TAG_variable65; CHECK: DW_AT_location (DW_OP_fbreg -4, DW_OP_deref_size 0x4, DW_OP_constu 0x20, DW_OP_shl, DW_OP_constu 0x21, DW_OP_shra, DW_OP_stack_value)66; CHECK: DW_AT_name ("y")67; CHECK: DW_TAG_variable68; CHECK: DW_AT_location (DW_OP_fbreg -4, DW_OP_plus_uconst 0x3, DW_OP_deref_size 0x1, DW_OP_constu 0x38, DW_OP_shl, DW_OP_constu 0x39, DW_OP_shr, DW_OP_stack_value)69; CHECK: DW_AT_name ("z")70; CHECK: DW_AT_location (DW_OP_fbreg -4, DW_OP_deref, DW_OP_stack_value)71; CHECK: DW_AT_name ("q")72 73define i32 @test4() !dbg !28 {74entry:75  %0 = alloca i32, align 476  tail call void @llvm.dbg.declare(metadata ptr %0, metadata !29, metadata !DIExpression(DW_OP_LLVM_extract_bits_zext, 31, 1)), !dbg !3077  tail call void @llvm.dbg.declare(metadata ptr %0, metadata !31, metadata !DIExpression(DW_OP_LLVM_extract_bits_sext, 1, 31)), !dbg !3078  tail call void @llvm.dbg.declare(metadata ptr %0, metadata !32, metadata !DIExpression(DW_OP_plus_uconst, 3, DW_OP_LLVM_extract_bits_zext, 1, 7)), !dbg !3079  tail call void @llvm.dbg.declare(metadata ptr %0, metadata !33, metadata !DIExpression(DW_OP_LLVM_extract_bits_zext, 0, 64)), !dbg !3080  ret i32 0, !dbg !3081}82 83declare void @llvm.dbg.declare(metadata, metadata, metadata)84declare void @llvm.dbg.value(metadata, metadata, metadata)85 86!llvm.dbg.cu = !{!2}87!llvm.module.flags = !{!11, !12}88 89!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())90!1 = distinct !DIGlobalVariable(name: "g", scope: !2, file: !3, type: !5, isLocal: false, isDefinition: true)91!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false, nameTableKind: None)92!3 = !DIFile(filename: "DW_OP_bit_piece.cpp", directory: "./")93!4 = !{!0}94!5 = !DIDerivedType(tag: DW_TAG_typedef, name: "struct_t", file: !3, baseType: !6)95!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !3, size: 8, flags: DIFlagTypePassByValue, elements: !7, identifier: "_ZTS8struct_t")96!7 = !{!8, !10}97!8 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !6, file: !3, baseType: !9, size: 3, flags: DIFlagBitField, extraData: i64 0)98!9 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)99!10 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !6, file: !3, baseType: !9, size: 4, offset: 3, flags: DIFlagBitField, extraData: i64 0)100!11 = !{i32 7, !"Dwarf Version", i32 5}101!12 = !{i32 2, !"Debug Info Version", i32 3}102!13 = distinct !DISubprogram(name: "test1", linkageName: "test1", scope: !3, file: !3, type: !14, spFlags: DISPFlagDefinition, unit: !2)103!14 = !DISubroutineType(types: !15)104!15 = !{!9}105!16 = !DILocalVariable(name: "x", scope: !13, file: !3, type: !9)106!17 = !DILocation(line: 0, scope: !13)107!18 = !DILocalVariable(name: "y", scope: !13, file: !3, type: !19)108!19 = !DIBasicType(name: "signed int", size: 32, encoding: DW_ATE_signed)109!20 = distinct !DISubprogram(name: "test2", linkageName: "test2", scope: !3, file: !3, type: !14, spFlags: DISPFlagDefinition, unit: !2)110!21 = !DILocalVariable(name: "x", scope: !20, file: !3, type: !9)111!22 = !DILocation(line: 0, scope: !20)112!23 = !DILocalVariable(name: "y", scope: !20, file: !3, type: !19)113!24 = distinct !DISubprogram(name: "test3", linkageName: "test3", scope: !3, file: !3, type: !14, spFlags: DISPFlagDefinition, unit: !2)114!25 = !DILocalVariable(name: "x", scope: !24, file: !3, type: !9)115!26 = !DILocation(line: 0, scope: !24)116!27 = !DILocalVariable(name: "y", scope: !24, file: !3, type: !19)117!28 = distinct !DISubprogram(name: "test4", linkageName: "test4", scope: !3, file: !3, type: !14, spFlags: DISPFlagDefinition, unit: !2)118!29 = !DILocalVariable(name: "x", scope: !28, file: !3, type: !9)119!30 = !DILocation(line: 0, scope: !28)120!31 = !DILocalVariable(name: "y", scope: !28, file: !3, type: !19)121!32 = !DILocalVariable(name: "z", scope: !28, file: !3, type: !9)122!33 = !DILocalVariable(name: "q", scope: !28, file: !3, type: !34)123!34 = !DIBasicType(name: "uint64_t", size: 64, encoding: DW_ATE_unsigned)124