• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -sroa -S -o - %s | FileCheck %s
2; REQUIRES: object-emission
3target datalayout = "e-m:o-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
4target triple = "thumbv7-apple-unknown-macho"
5
6; generated from (-triple thumbv7-apple-unknown-macho):
7;   void f(_Complex double c) { c = 0; }
8
9; Function Attrs: nounwind
10define arm_aapcscc void @f([2 x i64] %c.coerce) #0 !dbg !4 {
11entry:
12  %c = alloca { double, double }, align 8
13  %0 = bitcast { double, double }* %c to [2 x i64]*
14  store [2 x i64] %c.coerce, [2 x i64]* %0, align 8
15  call void @llvm.dbg.declare(metadata { double, double }* %c, metadata !14, metadata !15), !dbg !16
16  %c.realp = getelementptr inbounds { double, double }, { double, double }* %c, i32 0, i32 0, !dbg !17
17  %c.imagp = getelementptr inbounds { double, double }, { double, double }* %c, i32 0, i32 1, !dbg !17
18  store double 0.000000e+00, double* %c.realp, align 8, !dbg !17
19  ; SROA will split the complex double into two i64 values, because there is
20  ; no native double data type available.
21  ; Test that debug info for both values survives:
22  ; CHECK: call void @llvm.dbg.value(metadata i64 0, i64 0,
23  ; CHECK-SAME:                      metadata ![[C:.*]], metadata ![[REAL:.*]])
24  store double 0.000000e+00, double* %c.imagp, align 8, !dbg !17
25  ; CHECK: call void @llvm.dbg.value(metadata i64 0, i64 0,
26  ; CHECK-SAME:                      metadata ![[C]], metadata ![[IMG:.*]])
27  ret void, !dbg !18
28}
29; CHECK: ![[REAL]] = !DIExpression(DW_OP_bit_piece, 0, 64)
30; CHECK: ![[IMG]] = !DIExpression(DW_OP_bit_piece, 64, 64)
31
32; Function Attrs: nounwind readnone
33declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
34
35attributes #0 = { nounwind }
36attributes #1 = { nounwind readnone }
37
38!llvm.dbg.cu = !{!0}
39!llvm.module.flags = !{!9, !10, !11, !12}
40!llvm.ident = !{!13}
41
42!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)
43!1 = !DIFile(filename: "<stdin>", directory: "/")
44!2 = !{}
45!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, variables: !2)
46!5 = !DIFile(filename: "test.c", directory: "/")
47!6 = !DISubroutineType(types: !7)
48!7 = !{null, !8}
49!8 = !DIBasicType(name: "complex", size: 128, align: 64, encoding: DW_ATE_complex_float)
50!9 = !{i32 2, !"Dwarf Version", i32 2}
51!10 = !{i32 2, !"Debug Info Version", i32 3}
52!11 = !{i32 1, !"wchar_size", i32 4}
53!12 = !{i32 1, !"min_enum_size", i32 4}
54!13 = !{!"clang version 3.9.0 (trunk 259998) (llvm/trunk 259999)"}
55!14 = !DILocalVariable(name: "c", arg: 1, scope: !4, file: !5, line: 1, type: !8)
56!15 = !DIExpression()
57!16 = !DILocation(line: 1, column: 24, scope: !4)
58!17 = !DILocation(line: 1, column: 31, scope: !4)
59!18 = !DILocation(line: 1, column: 36, scope: !4)
60