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