xref: /llvm-project/llvm/test/DebugInfo/ARM/split-complex.ll (revision d59ce7d0eaada995e1a8f262f1ff33888575332c)
1; RUN: llc -mtriple=thumbv7-apple-unknown-macho -O0 -filetype=obj -o %t.o %s
2; RUN: llvm-dwarfdump -v -debug-info %t.o | FileCheck %s
3
4; generated from (-triple thumbv7-apple-unknown-macho -Os):
5;   void f(_Complex double c) { c = 0; }
6
7; Function Attrs: nounwind readnone
8define arm_aapcscc void @f([2 x i64] %c.coerce) #0 !dbg !4 {
9entry:
10  tail call void @llvm.dbg.declare(metadata { double, double }* undef, metadata !14, metadata !15), !dbg !16
11  ; The target has no native double type.
12  ; SROA split the complex value into two i64 values.
13  ; CHECK: DW_TAG_formal_parameter
14  ; CHECK-NEXT:  DW_AT_location [DW_FORM_block1]	(DW_OP_lit0, DW_OP_piece 0x8)
15  ; CHECK-NEXT:  DW_AT_name {{.*}} "c"
16  tail call void @llvm.dbg.value(metadata i64 0, metadata !14, metadata !17), !dbg !16
17  ; Manually removed to disable location list emission:
18  ; tail call void @llvm.dbg.value(metadata i64 0, metadata !14, metadata !18), !dbg !16
19  ret void, !dbg !19
20}
21
22; Function Attrs: nounwind readnone
23declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
24
25; Function Attrs: nounwind readnone
26declare void @llvm.dbg.value(metadata, metadata, metadata) #0
27
28attributes #0 = { nounwind readnone }
29
30!llvm.dbg.cu = !{!0}
31!llvm.module.flags = !{!9, !10, !11, !12}
32!llvm.ident = !{!13}
33
34!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 259998) (llvm/trunk 259999)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
35!1 = !DIFile(filename: "<stdin>", directory: "/")
36!2 = !{}
37!4 = distinct !DISubprogram(name: "f", scope: !5, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
38!5 = !DIFile(filename: "test.c", directory: "/")
39!6 = !DISubroutineType(types: !7)
40!7 = !{null, !8}
41!8 = !DIBasicType(name: "complex", size: 128, align: 64, encoding: DW_ATE_complex_float)
42!9 = !{i32 2, !"Dwarf Version", i32 2}
43!10 = !{i32 2, !"Debug Info Version", i32 3}
44!11 = !{i32 1, !"wchar_size", i32 4}
45!12 = !{i32 1, !"min_enum_size", i32 4}
46!13 = !{!"clang version 3.9.0 (trunk 259998) (llvm/trunk 259999)"}
47!14 = !DILocalVariable(name: "c", arg: 1, scope: !4, file: !5, line: 1, type: !8)
48!15 = !DIExpression()
49!16 = !DILocation(line: 1, column: 24, scope: !4)
50!17 = !DIExpression(DW_OP_LLVM_fragment, 0, 64)
51!18 = !DIExpression(DW_OP_LLVM_fragment, 64, 64)
52!19 = !DILocation(line: 1, column: 36, scope: !4)
53