Adrian Prantl | c133d8a | 2017-12-14 22:55:06 +0000 | [diff] [blame] | 1 | ; RUN: llc -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s |
| 2 | ; Generated from: |
| 3 | ; void * __attribute__ (( regparm(2) )) f(void *, void *); |
| 4 | ; void * __attribute__ (( regparm(0) )) g(void *, void *); |
| 5 | ; |
| 6 | ; void *g(void *t, void *k) { |
| 7 | ; if (k == (void *)0) |
| 8 | ; return (void *)0; |
| 9 | ; return f(t, k); |
| 10 | ; } |
| 11 | |
| 12 | ; CHECK: DW_TAG_formal_parameter |
| 13 | ; CHECK-NEXT: DW_AT_location (DW_OP_fbreg +4) |
| 14 | ; CHECK-NEXT: DW_AT_name ("t") |
| 15 | ; CHECK: DW_TAG_formal_parameter |
| 16 | ; CHECK-NEXT: DW_AT_location (DW_OP_fbreg +8) |
| 17 | ; CHECK-NEXT: DW_AT_name ("k") |
| 18 | |
| 19 | source_filename = "t.c" |
| 20 | target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128" |
| 21 | target triple = "i386--linux-gnu" |
| 22 | |
| 23 | ; Function Attrs: nounwind |
| 24 | define i8* @g(i8* %t, i8* %k) local_unnamed_addr #0 !dbg !10 { |
| 25 | entry: |
| 26 | call void @llvm.dbg.value(metadata i8* %t, metadata !14, metadata !DIExpression()), !dbg !16 |
| 27 | call void @llvm.dbg.value(metadata i8* %k, metadata !15, metadata !DIExpression()), !dbg !17 |
| 28 | %cmp = icmp eq i8* %k, null, !dbg !18 |
| 29 | br i1 %cmp, label %return, label %if.end, !dbg !20 |
| 30 | |
| 31 | if.end: ; preds = %entry |
| 32 | %call = tail call i8* @f(i8* inreg %t, i8* inreg nonnull %k) #3, !dbg !21 |
| 33 | br label %return, !dbg !22 |
| 34 | |
| 35 | return: ; preds = %entry, %if.end |
| 36 | %retval.0 = phi i8* [ %call, %if.end ], [ null, %entry ] |
| 37 | ret i8* %retval.0, !dbg !23 |
| 38 | } |
| 39 | |
| 40 | declare i8* @f(i8* inreg, i8* inreg) local_unnamed_addr |
| 41 | |
| 42 | ; Function Attrs: nounwind readnone speculatable |
| 43 | declare void @llvm.dbg.value(metadata, metadata, metadata) #2 |
| 44 | |
| 45 | attributes #0 = { nounwind } |
| 46 | attributes #2 = { nounwind readnone speculatable } |
| 47 | attributes #3 = { nounwind } |
| 48 | |
| 49 | !llvm.dbg.cu = !{!0} |
| 50 | !llvm.module.flags = !{!5, !6, !7, !8} |
| 51 | !llvm.ident = !{!9} |
| 52 | |
| 53 | !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 6.0.0 (llvm/trunk 319230)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3) |
| 54 | !1 = !DIFile(filename: "t.c", directory: "/") |
| 55 | !2 = !{} |
| 56 | !3 = !{!4} |
| 57 | !4 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 32) |
| 58 | !5 = !{i32 1, !"NumRegisterParameters", i32 0} |
| 59 | !6 = !{i32 2, !"Dwarf Version", i32 4} |
| 60 | !7 = !{i32 2, !"Debug Info Version", i32 3} |
| 61 | !8 = !{i32 1, !"wchar_size", i32 4} |
| 62 | !9 = !{!"clang version 6.0.0 (llvm/trunk 319230)"} |
Shiva Chen | 2c86455 | 2018-05-09 02:40:45 +0000 | [diff] [blame] | 63 | !10 = distinct !DISubprogram(name: "g", scope: !1, file: !1, line: 4, type: !11, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !13) |
Adrian Prantl | c133d8a | 2017-12-14 22:55:06 +0000 | [diff] [blame] | 64 | !11 = !DISubroutineType(types: !12) |
| 65 | !12 = !{!4, !4, !4} |
| 66 | !13 = !{!14, !15} |
| 67 | !14 = !DILocalVariable(name: "t", arg: 1, scope: !10, file: !1, line: 4, type: !4) |
| 68 | !15 = !DILocalVariable(name: "k", arg: 2, scope: !10, file: !1, line: 4, type: !4) |
| 69 | !16 = !DILocation(line: 4, column: 15, scope: !10) |
| 70 | !17 = !DILocation(line: 4, column: 24, scope: !10) |
| 71 | !18 = !DILocation(line: 5, column: 9, scope: !19) |
| 72 | !19 = distinct !DILexicalBlock(scope: !10, file: !1, line: 5, column: 7) |
| 73 | !20 = !DILocation(line: 5, column: 7, scope: !10) |
| 74 | !21 = !DILocation(line: 7, column: 10, scope: !10) |
| 75 | !22 = !DILocation(line: 7, column: 3, scope: !10) |
| 76 | !23 = !DILocation(line: 8, column: 1, scope: !10) |