| 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=i386-unknown-unknown -mcpu=core2 %t.ll -o %t -filetype=obj |
| 6 |
; RUN: llvm-dwarfdump -debug-line %t | FileCheck %s |
| 7 |
|
| 8 |
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" |
| 9 |
target triple = "spir64-unknown-unknown" |
| 10 |
; |
| 11 |
; Generated from: |
| 12 |
; |
| 13 |
; #1 void foo(int); |
| 14 |
; #2 void baz(int i) { |
| 15 |
; #3 if (i) {foo(i+1);/*discriminator 1*/} |
| 16 |
; #4 } |
| 17 |
; |
| 18 |
; The intent is to test discriminator 1 generated for all instructions in |
| 19 |
; the taken branch. |
| 20 |
|
| 21 |
; Function Attrs: uwtable |
| 22 |
define void @_Z3bazi(i32) #0 !dbg !6 { |
| 23 |
%2 = alloca i32, align 4 |
| 24 |
store i32 %0, i32* %2, align 4 |
| 25 |
call void @llvm.dbg.declare(metadata i32* %2, metadata !10, metadata !11), !dbg !12 |
| 26 |
%3 = load i32, i32* %2, align 4, !dbg !13 |
| 27 |
%4 = icmp ne i32 %3, 0, !dbg !13 |
| 28 |
br i1 %4, label %5, label %8, !dbg !15 |
| 29 |
|
| 30 |
; <label>:5: ; preds = %1 |
| 31 |
%6 = load i32, i32* %2, align 4, !dbg !16 |
| 32 |
%7 = add nsw i32 %6, 1, !dbg !19 |
| 33 |
call void @_Z3fooi(i32 %7), !dbg !20 |
| 34 |
br label %8, !dbg !21 |
| 35 |
|
| 36 |
; <label>:8: ; preds = %5, %1 |
| 37 |
ret void, !dbg !22 |
| 38 |
} |
| 39 |
|
| 40 |
; Function Attrs: nounwind readnone |
| 41 |
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 |
| 42 |
|
| 43 |
declare void @_Z3fooi(i32) #2 |
| 44 |
|
| 45 |
attributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 46 |
attributes #1 = { nounwind readnone } |
| 47 |
attributes #2 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 48 |
|
| 49 |
!llvm.dbg.cu = !{!0} |
| 50 |
!llvm.module.flags = !{!3, !4} |
| 51 |
!llvm.ident = !{!5} |
| 52 |
|
| 53 |
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 267518)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) |
| 54 |
!1 = !DIFile(filename: "test.cc", directory: ".") |
| 55 |
!2 = !{} |
| 56 |
!3 = !{i32 2, !"Dwarf Version", i32 4} |
| 57 |
!4 = !{i32 2, !"Debug Info Version", i32 3} |
| 58 |
!5 = !{!"clang version 3.9.0 (trunk 267518)"} |
| 59 |
!6 = distinct !DISubprogram(name: "baz", linkageName: "_Z3bazi", scope: !1, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) |
| 60 |
!7 = !DISubroutineType(types: !8) |
| 61 |
!8 = !{null, !9} |
| 62 |
!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 63 |
!10 = !DILocalVariable(name: "i", arg: 1, scope: !6, file: !1, line: 2, type: !9) |
| 64 |
!11 = !DIExpression() |
| 65 |
!12 = !DILocation(line: 2, column: 14, scope: !6) |
| 66 |
!13 = !DILocation(line: 3, column: 7, scope: !14) |
| 67 |
!14 = distinct !DILexicalBlock(scope: !6, file: !1, line: 3, column: 7) |
| 68 |
!15 = !DILocation(line: 3, column: 7, scope: !6) |
| 69 |
!16 = !DILocation(line: 3, column: 15, scope: !17) |
| 70 |
!17 = !DILexicalBlockFile(scope: !18, file: !1, discriminator: 1) |
| 71 |
!18 = distinct !DILexicalBlock(scope: !14, file: !1, line: 3, column: 10) |
| 72 |
!19 = !DILocation(line: 3, column: 16, scope: !17) |
| 73 |
!20 = !DILocation(line: 3, column: 11, scope: !17) |
| 74 |
!21 = !DILocation(line: 3, column: 21, scope: !17) |
| 75 |
!22 = !DILocation(line: 4, column: 1, scope: !6) |
| 76 |
|
| 77 |
; CHECK: Address Line Column File ISA Discriminator Flags |
| 78 |
; CHECK: ------------------ ------ ------ ------ --- ------------- ------------- |
| 79 |
; CHECK: {{.*}} 3 15 1 0 1 |
| 80 |
; CHECK: {{.*}} 3 16 1 0 1 |
| 81 |
; CHECK: {{.*}} 3 11 1 0 1 |