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