1 ; RUN: llc -mtriple=nvptx64-nvidia-cuda < %s | FileCheck %s
2 ; Generated with -O1 from:
16 ; Test that we generate valid debug info for optimized code,
17 ; particularly variables that are described as constants and passed
20 ; CHECK: DEBUG_VALUE: foo:i <- 3
21 ; CHECK: DEBUG_VALUE: foo:i <- 7
22 ; CHECK: DEBUG_VALUE: foo:i <- %
23 ; CHECK: DEBUG_VALUE: foo:i <- [DW_OP_deref] $vrdepot
25 ; Function Attrs: nounwind ssp uwtable
26 define i32 @foo() #0 !dbg !4 {
28 %i = alloca i32, align 4
29 call void @llvm.dbg.value(metadata i32 3, metadata !10, metadata !DIExpression()), !dbg !15
30 %call = call i32 @f3(i32 3) #3, !dbg !16
31 call void @llvm.dbg.value(metadata i32 7, metadata !10, metadata !DIExpression()), !dbg !18
32 %call1 = call i32 (...) @f1() #3, !dbg !19
33 call void @llvm.dbg.value(metadata i32 %call1, metadata !10, metadata !DIExpression()), !dbg !19
34 store i32 %call1, i32* %i, align 4, !dbg !19, !tbaa !20
35 call void @llvm.dbg.value(metadata i32* %i, metadata !10, metadata !DIExpression(DW_OP_deref)), !dbg !24
36 call void @f2(i32* %i) #3, !dbg !24
44 declare void @f2(i32*)
46 ; Function Attrs: nounwind readnone
47 declare void @llvm.dbg.value(metadata, metadata, metadata) #2
49 attributes #0 = { nounwind ssp uwtable }
50 attributes #2 = { nounwind readnone }
51 attributes #3 = { nounwind }
54 !llvm.module.flags = !{!11, !12}
57 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
58 !1 = !DIFile(filename: "dbg-value-const-byref.c", directory: "")
60 !4 = distinct !DISubprogram(name: "foo", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0, scopeLine: 5, file: !1, scope: !5, type: !6, retainedNodes: !9)
61 !5 = !DIFile(filename: "dbg-value-const-byref.c", directory: "")
62 !6 = !DISubroutineType(types: !7)
64 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
66 !10 = !DILocalVariable(name: "i", line: 6, scope: !4, file: !5, type: !8)
67 !11 = !{i32 2, !"Dwarf Version", i32 2}
68 !12 = !{i32 1, !"Debug Info Version", i32 3}
69 !13 = !{!"clang version 3.5.0 "}
71 !15 = !DILocation(line: 6, scope: !4)
72 !16 = !DILocation(line: 7, scope: !4)
74 !18 = !DILocation(line: 8, scope: !4)
75 !19 = !DILocation(line: 9, scope: !4)
76 !20 = !{!21, !21, i64 0}
77 !21 = !{!"int", !22, i64 0}
78 !22 = !{!"omnipotent char", !23, i64 0}
79 !23 = !{!"Simple C/C++ TBAA"}
80 !24 = !DILocation(line: 10, scope: !4)
81 !25 = !DILocation(line: 11, scope: !4)