| 1 |
; RUN: llvm-as %s -o %t.bc |
| 2 |
; RUN: llvm-spirv %t.bc -o %t.spv |
| 3 |
|
| 4 |
source_filename = "debug-label-bitcode.c" |
| 5 |
|
| 6 |
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" |
| 7 |
target triple = "spir64-unknown-linux" |
| 8 |
|
| 9 |
; Function Attrs: noinline nounwind optnone |
| 10 |
define i32 @foo(i32 signext %a, i32 signext %b) !dbg !4 { |
| 11 |
entry: |
| 12 |
%a.addr = alloca i32, align 4 |
| 13 |
%b.addr = alloca i32, align 4 |
| 14 |
%sum = alloca i32, align 4 |
| 15 |
store i32 %a, i32* %a.addr, align 4 |
| 16 |
store i32 %b, i32* %b.addr, align 4 |
| 17 |
br label %top |
| 18 |
|
| 19 |
top: ; preds = %entry |
| 20 |
call void @llvm.dbg.label(metadata !9), !dbg !10 |
| 21 |
%0 = load i32, i32* %a.addr, align 4 |
| 22 |
%1 = load i32, i32* %b.addr, align 4 |
| 23 |
%add = add nsw i32 %0, %1 |
| 24 |
store i32 %add, i32* %sum, align 4 |
| 25 |
br label %done |
| 26 |
|
| 27 |
done: ; preds = %top |
| 28 |
call void @llvm.dbg.label(metadata !11), !dbg !12 |
| 29 |
%2 = load i32, i32* %sum, align 4 |
| 30 |
ret i32 %2 |
| 31 |
} |
| 32 |
|
| 33 |
; Function Attrs: nounwind readnone speculatable |
| 34 |
declare void @llvm.dbg.label(metadata) |
| 35 |
|
| 36 |
!llvm.dbg.cu = !{!0} |
| 37 |
!llvm.module.flags = !{!3} |
| 38 |
|
| 39 |
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang 6.0.0", isOptimized: false, emissionKind: FullDebug, enums: !2) |
| 40 |
!1 = !DIFile(filename: "debug-label-bitcode.c", directory: "./") |
| 41 |
!2 = !{} |
| 42 |
!3 = !{i32 2, !"Debug Info Version", i32 3} |
| 43 |
!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0, retainedNodes: !5) |
| 44 |
!5 = !{!9} |
| 45 |
!6 = !DISubroutineType(types: !7) |
| 46 |
!7 = !{!8, !8, !8} |
| 47 |
!8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 48 |
!9 = !DILabel(scope: !4, name: "top", file: !1, line: 4) |
| 49 |
!10 = !DILocation(line: 4, column: 1, scope: !4) |
| 50 |
!11 = !DILabel(scope: !4, name: "done", file: !1, line: 7) |
| 51 |
!12 = !DILocation(line: 7, column: 1, scope: !4) |