Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/DebugInfo/X86/double-declare.ll

raw
1 ; RUN: llvm-as < %s -o %t.bc
2 ; RUN: llvm-spirv %t.bc -o %t.spv
3 ; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o %t.ll
4
5 ; RUN: llc -mtriple=x86_64-apple-darwin -O0 -filetype=obj -o - < %t.ll | llvm-dwarfdump -v -debug-info - | FileCheck %s
6
7 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
8 target triple = "spir64-unknown-unknown"
9 ; PR33157. Don't crash on duplicate dbg.declare.
10 ; CHECK: DW_TAG_formal_parameter
11 ; CHECK: DW_AT_location [DW_FORM_exprloc]
12 ; CHECK-NOT: DW_AT_location
13 @g = external global i32
14 @h = external global i32
15
16 declare void @llvm.dbg.declare(metadata, metadata, metadata)
17
18 define void @f(i32* byval(i32) %p, i1 %c) !dbg !5 {
19 br i1 %c, label %x, label %y
20
21 x:
22 call void @llvm.dbg.declare(metadata i32* %p, metadata !10, metadata !DIExpression()), !dbg !12
23 store i32 42, i32* @g, !dbg !12
24 br label %done
25
26 y:
27 call void @llvm.dbg.declare(metadata i32* %p, metadata !10, metadata !DIExpression()), !dbg !12
28 store i32 42, i32* @h, !dbg !12
29 br label %done
30
31 done:
32 ret void
33 }
34
35 !llvm.dbg.cu = !{!0}
36 !llvm.module.flags = !{!22, !23}
37
38 !0 = distinct !DICompileUnit(language: DW_LANG_ObjC, file: !1, producer: "clang version 5.0.0 ", isOptimized: true, runtimeVersion: 2, emissionKind: FullDebug)
39 !1 = !DIFile(filename: "<stdin>", directory: "C:\5Csrc\5Cllvm-project\5Cbuild")
40 !5 = distinct !DISubprogram(name: "f", isLocal: true, isDefinition: true, scopeLine: 37, flags: DIFlagPrototyped, isOptimized: true, unit: !0, type: !99, scope: !1)
41 !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
42 !10 = !DILocalVariable(name: "aRect", arg: 1, scope: !11, file: !1, line: 38, type: !6)
43 !11 = distinct !DILexicalBlock(scope: !98, file: !1, line: 38)
44 !12 = !DILocation(line: 43, scope: !11, inlinedAt: !13)
45 !13 = distinct !DILocation(line: 43, scope: !5)
46 !22 = !{i32 2, !"Dwarf Version", i32 4}
47 !23 = !{i32 2, !"Debug Info Version", i32 3}
48 !62 = !{!10}
49 !98 = distinct !DISubprogram(name: "NSMaxX", scope: !1, file: !1, line: 27, isLocal: true, isDefinition: true, scopeLine: 27, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !62, type: !99)
50 !99 = !DISubroutineType(types: !100)
51 !100 = !{null}