| 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, int); |
| 14 |
; #2 int bar(); |
| 15 |
; #3 void baz() { |
| 16 |
; #4 foo/*discriminator 1*/(bar(), |
| 17 |
; #5 bar());bar()/*discriminator 1*/; |
| 18 |
; #6 } |
| 19 |
; |
| 20 |
; The intent is to test discriminator 1 generated for both line #4 and #5. |
| 21 |
; The instruction sequence in the final binary is: |
| 22 |
; line 4 discriminator 0 |
| 23 |
; line 5 discriminator 0 |
| 24 |
; line 4 discriminator 1 |
| 25 |
; line 5 discriminator 1 |
| 26 |
; We need to ensure that the discriminators for the last two instructions |
| 27 |
; are both 1. |
| 28 |
|
| 29 |
; Function Attrs: uwtable |
| 30 |
define void @_Z3bazv() #0 !dbg !6 { |
| 31 |
%1 = call i32 @_Z3barv(), !dbg !9 |
| 32 |
%2 = call i32 @_Z3barv(), !dbg !10 |
| 33 |
call void @_Z3fooii(i32 %1, i32 %2), !dbg !11 |
| 34 |
%3 = call i32 @_Z3barv(), !dbg !13 |
| 35 |
ret void, !dbg !14 |
| 36 |
} |
| 37 |
|
| 38 |
declare void @_Z3fooii(i32, i32) #1 |
| 39 |
|
| 40 |
declare i32 @_Z3barv() #1 |
| 41 |
|
| 42 |
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" } |
| 43 |
attributes #1 = { "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" } |
| 44 |
|
| 45 |
!llvm.dbg.cu = !{!0} |
| 46 |
!llvm.module.flags = !{!3, !4} |
| 47 |
!llvm.ident = !{!5} |
| 48 |
|
| 49 |
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 267219)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) |
| 50 |
!1 = !DIFile(filename: "test.cc", directory: ".") |
| 51 |
!2 = !{} |
| 52 |
!3 = !{i32 2, !"Dwarf Version", i32 4} |
| 53 |
!4 = !{i32 2, !"Debug Info Version", i32 3} |
| 54 |
!5 = !{!"clang version 3.9.0 (trunk 267219)"} |
| 55 |
!6 = distinct !DISubprogram(name: "baz", linkageName: "_Z3bazv", scope: !1, file: !1, line: 3, type: !7, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) |
| 56 |
!7 = !DISubroutineType(types: !8) |
| 57 |
!8 = !{null} |
| 58 |
!9 = !DILocation(line: 4, column: 7, scope: !6) |
| 59 |
!10 = !DILocation(line: 5, column: 14, scope: !6) |
| 60 |
!11 = !DILocation(line: 4, column: 3, scope: !12) |
| 61 |
!12 = !DILexicalBlockFile(scope: !6, file: !1, discriminator: 1) |
| 62 |
!13 = !DILocation(line: 5, column: 21, scope: !12) |
| 63 |
!14 = !DILocation(line: 6, column: 1, scope: !6) |
| 64 |
|
| 65 |
; CHECK: Address Line Column File ISA Discriminator Flags |
| 66 |
; CHECK: ------------------ ------ ------ ------ --- ------------- ------------- |
| 67 |
; CHECK: {{.*}} 4 3 1 0 1 {{.*}} |
| 68 |
; CHECK: {{.*}} 5 21 1 0 1 {{.*}} |