blob: fe8070587383213be37aa331c98a3005de3ec642 [file] [log] [blame]
Adrian Prantl64945562017-03-07 17:28:54 +00001; RUN: llvm-as < %s -o %t
2; RUN: llvm-dis < %t -o - | FileCheck %s
Adrian Prantl536a5672017-03-07 18:26:36 +00003; Created at -O1 from:
4; int sink(int);
5; __attribute__((always_inline)) int f(int i) { return sink(i); }
6; __attribute__((always_inline)) int g(int j) { return sink(j); }
7; __attribute__((nodebug)) int nodebug(int k) { return f(k)+g(k); }
Adrian Prantl64945562017-03-07 17:28:54 +00008source_filename = "t.c"
9target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
10target triple = "x86_64-apple-macosx10.12.0"
11
Adrian Prantl536a5672017-03-07 18:26:36 +000012declare i32 @sink(i32) local_unnamed_addr
Adrian Prantl64945562017-03-07 17:28:54 +000013
Adrian Prantl536a5672017-03-07 18:26:36 +000014define i32 @nodebug(i32 %k) local_unnamed_addr #2 {
Adrian Prantl64945562017-03-07 17:28:54 +000015entry:
16; This should not set off the FnArg Verifier. The two variables are in differrent scopes.
Adrian Prantl536a5672017-03-07 18:26:36 +000017 tail call void @llvm.dbg.value(metadata i32 %k, i64 0, metadata !12, metadata !13) #4, !dbg !14
18 %call.k = tail call i32 @sink(i32 %k) #4, !dbg !15
19 tail call void @llvm.dbg.value(metadata i32 %k, i64 0, metadata !19, metadata !13) #4, !dbg !20
20 %call.k3 = tail call i32 @sink(i32 %k) #4, !dbg !21
21 %add = add nsw i32 %call.k3, %call.k
22 ret i32 %add
Adrian Prantl64945562017-03-07 17:28:54 +000023}
24
25; Function Attrs: nounwind readnone
Adrian Prantl536a5672017-03-07 18:26:36 +000026declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #3
Adrian Prantl64945562017-03-07 17:28:54 +000027
Adrian Prantl536a5672017-03-07 18:26:36 +000028attributes #2 = { nounwind ssp uwtable }
29attributes #3 = { nounwind readnone }
Adrian Prantl64945562017-03-07 17:28:54 +000030
31!llvm.dbg.cu = !{!0}
32!llvm.module.flags = !{!3, !4, !5}
33!llvm.ident = !{!6}
34
Adrian Prantl536a5672017-03-07 18:26:36 +000035!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 5.0.0 (trunk 297153) (llvm/trunk 297155)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
Adrian Prantl64945562017-03-07 17:28:54 +000036!1 = !DIFile(filename: "t.c", directory: "/tmp")
37!2 = !{}
38!3 = !{i32 2, !"Dwarf Version", i32 4}
39!4 = !{i32 2, !"Debug Info Version", i32 3}
40!5 = !{i32 1, !"PIC Level", i32 2}
41!6 = !{!"clang version 5.0.0 (trunk 297153) (llvm/trunk 297155)"}
Shiva Chena8a13bc2018-05-09 02:40:45 +000042!7 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !11)
Adrian Prantl64945562017-03-07 17:28:54 +000043!8 = !DISubroutineType(types: !9)
Adrian Prantl536a5672017-03-07 18:26:36 +000044!9 = !{!10, !10}
45!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
46!11 = !{!12}
47; CHECK: !DILocalVariable(name: "i", arg: 1
48!12 = !DILocalVariable(name: "i", arg: 1, scope: !7, file: !1, line: 2, type: !10)
49!13 = !DIExpression()
50!14 = !DILocation(line: 2, column: 42, scope: !7)
51!15 = !DILocation(line: 2, column: 54, scope: !7)
52!16 = !DILocation(line: 2, column: 47, scope: !7)
Shiva Chena8a13bc2018-05-09 02:40:45 +000053!17 = distinct !DISubprogram(name: "g", scope: !1, file: !1, line: 3, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !18)
Adrian Prantl536a5672017-03-07 18:26:36 +000054!18 = !{!19}
55; CHECK: !DILocalVariable(name: "j", arg: 1
56!19 = !DILocalVariable(name: "j", arg: 1, scope: !17, file: !1, line: 3, type: !10)
57!20 = !DILocation(line: 3, column: 42, scope: !17)
58!21 = !DILocation(line: 3, column: 54, scope: !17)
59!22 = !DILocation(line: 3, column: 47, scope: !17)