Adrian Prantl | 63d9695 | 2017-03-07 17:28:54 +0000 | [diff] [blame] | 1 | ; RUN: llvm-as < %s -o %t |
| 2 | ; RUN: llvm-dis < %t -o - | FileCheck %s |
Adrian Prantl | 654975b | 2017-03-07 17:55:36 +0000 | [diff] [blame] | 3 | ; Testcase from PR32042. |
Adrian Prantl | 63d9695 | 2017-03-07 17:28:54 +0000 | [diff] [blame] | 4 | ; Created at -02 from: |
| 5 | ; bool alpha(int); |
| 6 | ; bool bravo(int charlie) { return (alpha(charlie)); } |
| 7 | ; static int delta(int charlie) { return charlie + 1; } |
| 8 | ; __attribute__((nodebug)) bool echo(int foxtrot) { |
Adrian Prantl | 654975b | 2017-03-07 17:55:36 +0000 | [diff] [blame] | 9 | ; return bravo(delta(foxtrot)); |
Adrian Prantl | 63d9695 | 2017-03-07 17:28:54 +0000 | [diff] [blame] | 10 | ; } |
| 11 | |
| 12 | source_filename = "t.c" |
| 13 | target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" |
| 14 | target triple = "x86_64-apple-macosx10.12.0" |
| 15 | |
| 16 | define zeroext i1 @_Z5bravoi(i32 %charlie) local_unnamed_addr #0 !dbg !7 { |
| 17 | entry: |
| 18 | tail call void @llvm.dbg.value(metadata i32 %charlie, i64 0, metadata !13, metadata !14), !dbg !15 |
| 19 | %call = tail call zeroext i1 @_Z5alphai(i32 %charlie), !dbg !16 |
| 20 | ret i1 %call, !dbg !17 |
| 21 | } |
| 22 | |
| 23 | declare zeroext i1 @_Z5alphai(i32) local_unnamed_addr |
| 24 | |
| 25 | define zeroext i1 @_Z4echoi(i32 %foxtrot) local_unnamed_addr #0 { |
| 26 | entry: |
| 27 | ; This should not set off the FnArg Verifier. The two variables are in differrent scopes. |
| 28 | tail call void @llvm.dbg.value(metadata i32 %foxtrot, i64 0, metadata !18, metadata !14), !dbg !23 |
| 29 | %add.i = add nsw i32 %foxtrot, 1, !dbg !24 |
| 30 | tail call void @llvm.dbg.value(metadata i32 %add.i, i64 0, metadata !13, metadata !14), !dbg !15 |
| 31 | %call.i = tail call zeroext i1 @_Z5alphai(i32 %add.i), !dbg !16 |
| 32 | ret i1 %call.i |
| 33 | } |
| 34 | |
| 35 | ; Function Attrs: nounwind readnone |
| 36 | declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2 |
| 37 | |
| 38 | attributes #0 = { ssp uwtable } |
| 39 | attributes #2 = { nounwind readnone } |
| 40 | |
| 41 | !llvm.dbg.cu = !{!0} |
| 42 | !llvm.module.flags = !{!3, !4, !5} |
| 43 | !llvm.ident = !{!6} |
| 44 | |
| 45 | !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 297153) (llvm/trunk 297155)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) |
| 46 | !1 = !DIFile(filename: "t.c", directory: "/tmp") |
| 47 | !2 = !{} |
| 48 | !3 = !{i32 2, !"Dwarf Version", i32 4} |
| 49 | !4 = !{i32 2, !"Debug Info Version", i32 3} |
| 50 | !5 = !{i32 1, !"PIC Level", i32 2} |
| 51 | !6 = !{!"clang version 5.0.0 (trunk 297153) (llvm/trunk 297155)"} |
| 52 | !7 = distinct !DISubprogram(name: "bravo", linkageName: "_Z5bravoi", scope: !1, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !12) |
| 53 | !8 = !DISubroutineType(types: !9) |
| 54 | !9 = !{!10, !11} |
| 55 | !10 = !DIBasicType(name: "bool", size: 8, encoding: DW_ATE_boolean) |
| 56 | !11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 57 | !12 = !{!13} |
| 58 | ; CHECK: !DILocalVariable(name: "charlie", arg: 1 |
| 59 | !13 = !DILocalVariable(name: "charlie", arg: 1, scope: !7, file: !1, line: 2, type: !11) |
| 60 | !14 = !DIExpression() |
| 61 | !15 = !DILocation(line: 2, column: 16, scope: !7) |
| 62 | !16 = !DILocation(line: 2, column: 35, scope: !7) |
| 63 | !17 = !DILocation(line: 2, column: 27, scope: !7) |
| 64 | ; CHECK: !DILocalVariable(name: "charlie", arg: 1 |
| 65 | !18 = !DILocalVariable(name: "charlie", arg: 1, scope: !19, file: !1, line: 3, type: !11) |
| 66 | !19 = distinct !DISubprogram(name: "delta", linkageName: "_ZL5deltai", scope: !1, file: !1, line: 3, type: !20, isLocal: true, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !22) |
| 67 | !20 = !DISubroutineType(types: !21) |
| 68 | !21 = !{!11, !11} |
| 69 | !22 = !{!18} |
| 70 | !23 = !DILocation(line: 3, column: 22, scope: !19) |
| 71 | !24 = !DILocation(line: 3, column: 48, scope: !19) |