| 1 |
; REQUIRES: object-emission |
| 2 |
; RUN: llvm-as < %s -o %t.bc |
| 3 |
; RUN: llvm-spirv %t.bc -o %t.spv |
| 4 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o %t.ll |
| 5 |
|
| 6 |
; RUN: llc -O2 -filetype=obj -mtriple=x86_64-unknown-linux-gnu < %t.ll \ |
| 7 |
; RUN: | llvm-dwarfdump -debug-line - | FileCheck %s |
| 8 |
|
| 9 |
; RUN: llvm-spirv %t.bc -o %t.spv --spirv-debug-info-version=nonsemantic-shader-100 |
| 10 |
; RUN: llvm-spirv -r %t.spv -o - | llvm-dis -o %t.ll |
| 11 |
; RUN: llc -O2 -filetype=obj -mtriple=x86_64-unknown-linux-gnu < %t.ll \ |
| 12 |
; RUN: | llvm-dwarfdump -debug-line - | FileCheck %s |
| 13 |
|
| 14 |
; RUN: llvm-spirv %t.bc -o %t.spv --spirv-debug-info-version=nonsemantic-shader-200 |
| 15 |
; RUN: llvm-spirv -r %t.spv -o - | llvm-dis -o %t.ll |
| 16 |
; RUN: llc -O2 -filetype=obj -mtriple=x86_64-unknown-linux-gnu < %t.ll \ |
| 17 |
; RUN: | llvm-dwarfdump -debug-line - | FileCheck %s |
| 18 |
; |
| 19 |
; Generated with clang -O2 -g from |
| 20 |
; |
| 21 |
; typedef float __m128 __attribute__((__vector_size__(16))); |
| 22 |
; |
| 23 |
; extern __m128 doSomething(__m128, __m128); |
| 24 |
; |
| 25 |
; |
| 26 |
; __m128 foo(__m128 X) { // line 6 |
| 27 |
; const __m128 V = {0.5f, 0.5f, 0.5f, 0.5f}; // line 7 |
| 28 |
; __m128 Sub = X - V; // line 8 |
| 29 |
; __m128 Add = X + V; // line 9 |
| 30 |
; |
| 31 |
; __m128 Result = doSomething(Add, Sub); // line 11 |
| 32 |
; |
| 33 |
; return V - Result; // line 13 |
| 34 |
; } |
| 35 |
; |
| 36 |
; |
| 37 |
; We want to see line 13 after line 11 without any other line in between. |
| 38 |
; CHECK: 0x{{[0-9a-f]*}} 11 |
| 39 |
; CHECK-NOT: 0x{{[0-9a-f]*}} 8 |
| 40 |
; CHECK-NOT: 0x{{[0-9a-f]*}} 9 |
| 41 |
; CHECK: 0x{{[0-9a-f]*}} 13 |
| 42 |
; CHECK-NOT: 0x{{[0-9a-f]*}} 8 |
| 43 |
; CHECK-NOT: 0x{{[0-9a-f]*}} 9 |
| 44 |
|
| 45 |
; ModuleID = 'test.c' |
| 46 |
source_filename = "test.c" |
| 47 |
; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |
| 48 |
target triple = "spir64-unknown-unknown" |
| 49 |
|
| 50 |
; Function Attrs: nounwind uwtable |
| 51 |
define <4 x float> @foo(<4 x float> %X) local_unnamed_addr #0 !dbg !6 { |
| 52 |
entry: |
| 53 |
tail call void @llvm.dbg.value(metadata <4 x float> %X, metadata !15, metadata !21), !dbg !22 |
| 54 |
tail call void @llvm.dbg.value(metadata <4 x float> <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>, metadata !16, metadata !21), !dbg !23 |
| 55 |
%sub = fadd <4 x float> %X, <float -5.000000e-01, float -5.000000e-01, float -5.000000e-01, float -5.000000e-01>, !dbg !24 |
| 56 |
tail call void @llvm.dbg.value(metadata <4 x float> %sub, metadata !18, metadata !21), !dbg !25 |
| 57 |
%add = fadd <4 x float> %X, <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>, !dbg !26 |
| 58 |
tail call void @llvm.dbg.value(metadata <4 x float> %add, metadata !19, metadata !21), !dbg !27 |
| 59 |
%call = tail call <4 x float> @doSomething(<4 x float> %add, <4 x float> %sub) #3, !dbg !28 |
| 60 |
tail call void @llvm.dbg.value(metadata <4 x float> %call, metadata !20, metadata !21), !dbg !29 |
| 61 |
%sub1 = fsub <4 x float> <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>, %call, !dbg !30 |
| 62 |
ret <4 x float> %sub1, !dbg !31 |
| 63 |
} |
| 64 |
|
| 65 |
declare <4 x float> @doSomething(<4 x float>, <4 x float>) local_unnamed_addr #1 |
| 66 |
|
| 67 |
; Function Attrs: nounwind readnone |
| 68 |
declare void @llvm.dbg.value(metadata, metadata, metadata) #2 |
| 69 |
|
| 70 |
attributes #0 = { nounwind uwtable } |
| 71 |
attributes #1 = { nounwind uwtable } |
| 72 |
attributes #2 = { nounwind readnone } |
| 73 |
attributes #3 = { nounwind } |
| 74 |
|
| 75 |
!llvm.dbg.cu = !{!0} |
| 76 |
!llvm.module.flags = !{!3, !4} |
| 77 |
!llvm.ident = !{!5} |
| 78 |
|
| 79 |
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 278291)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) |
| 80 |
!1 = !DIFile(filename: "test.c", directory: "/home/test") |
| 81 |
!2 = !{} |
| 82 |
!3 = !{i32 2, !"Dwarf Version", i32 4} |
| 83 |
!4 = !{i32 2, !"Debug Info Version", i32 3} |
| 84 |
!5 = !{!"clang version 4.0.0 (trunk 278291)"} |
| 85 |
!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 6, type: !7, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !14) |
| 86 |
!7 = !DISubroutineType(types: !8) |
| 87 |
!8 = !{!9, !9} |
| 88 |
!9 = !DIDerivedType(tag: DW_TAG_typedef, name: "__m128", file: !1, line: 1, baseType: !10) |
| 89 |
!10 = !DICompositeType(tag: DW_TAG_array_type, baseType: !11, size: 128, align: 128, flags: DIFlagVector, elements: !12) |
| 90 |
!11 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float) |
| 91 |
!12 = !{!13} |
| 92 |
!13 = !DISubrange(count: 4) |
| 93 |
!14 = !{!15, !16, !18, !19, !20} |
| 94 |
!15 = !DILocalVariable(name: "X", arg: 1, scope: !6, file: !1, line: 6, type: !9) |
| 95 |
!16 = !DILocalVariable(name: "V", scope: !6, file: !1, line: 7, type: !17) |
| 96 |
!17 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !9) |
| 97 |
!18 = !DILocalVariable(name: "Sub", scope: !6, file: !1, line: 8, type: !9) |
| 98 |
!19 = !DILocalVariable(name: "Add", scope: !6, file: !1, line: 9, type: !9) |
| 99 |
!20 = !DILocalVariable(name: "Result", scope: !6, file: !1, line: 11, type: !9) |
| 100 |
!21 = !DIExpression() |
| 101 |
!22 = !DILocation(line: 6, column: 19, scope: !6) |
| 102 |
!23 = !DILocation(line: 7, column: 16, scope: !6) |
| 103 |
!24 = !DILocation(line: 8, column: 18, scope: !6) |
| 104 |
!25 = !DILocation(line: 8, column: 10, scope: !6) |
| 105 |
!26 = !DILocation(line: 9, column: 18, scope: !6) |
| 106 |
!27 = !DILocation(line: 9, column: 10, scope: !6) |
| 107 |
!28 = !DILocation(line: 11, column: 19, scope: !6) |
| 108 |
!29 = !DILocation(line: 11, column: 10, scope: !6) |
| 109 |
!30 = !DILocation(line: 13, column: 12, scope: !6) |
| 110 |
!31 = !DILocation(line: 13, column: 3, scope: !6) |