Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / test / DebugInfo / COFF / types-array.ll
blob16298dafbd4846a0b12dc4bb50fed51ea5058ad4
1 ; RUN: llc < %s -filetype=obj | llvm-readobj - -codeview | FileCheck %s
3 ; C++ source to regenerate:
4 ; $ cat t.cpp
5 ; void usevars(int, ...);
6 ; void f() {
7 ;   int a[5] = {9, 4, 5, 4, 2};
8 ;   usevars(a[0], a);
9 ; }
10 ; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll
12 ; CHECK: CodeViewTypes [
13 ; CHECK:   Section: .debug$T (6)
14 ; CHECK:   Magic: 0x4
15 ; CHECK:   ArgList (0x1000) {
16 ; CHECK:     TypeLeafKind: LF_ARGLIST (0x1201)
17 ; CHECK:     NumArgs: 0
18 ; CHECK:     Arguments [
19 ; CHECK:     ]
20 ; CHECK:   }
21 ; CHECK:   Procedure (0x1001) {
22 ; CHECK:     TypeLeafKind: LF_PROCEDURE (0x1008)
23 ; CHECK:     ReturnType: void (0x3)
24 ; CHECK:     CallingConvention: NearC (0x0)
25 ; CHECK:     FunctionOptions [ (0x0)
26 ; CHECK:     ]
27 ; CHECK:     NumParameters: 0
28 ; CHECK:     ArgListType: () (0x1000)
29 ; CHECK:   }
30 ; CHECK:   FuncId (0x1002) {
31 ; CHECK:     TypeLeafKind: LF_FUNC_ID (0x1601)
32 ; CHECK:     ParentScope: 0x0
33 ; CHECK:     FunctionType: void () (0x1001)
34 ; CHECK:     Name: f
35 ; CHECK:   }
36 ; CHECK:   Array (0x1003) {
37 ; CHECK:     TypeLeafKind: LF_ARRAY (0x1503)
38 ; CHECK:     ElementType: int (0x74)
39 ; CHECK:     IndexType: unsigned long (0x22)
40 ; CHECK:     SizeOf: 20
41 ; CHECK:     Name:
42 ; CHECK:   }
43 ; CHECK: ]
44 ; CHECK: CodeViewDebugInfo [
45 ; CHECK:   Section: .debug$S (5)
46 ; CHECK:   Magic: 0x4
47 ; CHECK:   Subsection [
48 ; CHECK:     SubSectionType: Symbols (0xF1)
49 ; CHECK:     {{.*}}Proc{{.*}}Sym {
50 ; CHECK:       PtrParent: 0x0
51 ; CHECK:       PtrEnd: 0x0
52 ; CHECK:       PtrNext: 0x0
53 ; CHECK:       CodeSize: 0x39
54 ; CHECK:       DbgStart: 0x0
55 ; CHECK:       DbgEnd: 0x0
56 ; CHECK:       FunctionType: f (0x1002)
57 ; CHECK:       CodeOffset: ?f@@YAXXZ+0x0
58 ; CHECK:       Segment: 0x0
59 ; CHECK:       Flags [ (0x0)
60 ; CHECK:       ]
61 ; CHECK:       DisplayName: f
62 ; CHECK:       LinkageName: ?f@@YAXXZ
63 ; CHECK:     }
64 ; CHECK:     LocalSym {
65 ; CHECK:       Type: 0x1003
66 ; CHECK:       Flags [ (0x0)
67 ; CHECK:       ]
68 ; CHECK:       VarName: a
69 ; CHECK:     }
70 ; CHECK:     DefRangeFramePointerRelSym {
71 ; CHECK:       Offset: -20
72 ; CHECK:       LocalVariableAddrRange {
73 ; CHECK:         OffsetStart: .text+0x6
74 ; CHECK:         ISectStart: 0x0
75 ; CHECK:         Range: 0x33
76 ; CHECK:       }
77 ; CHECK:     }
78 ; CHECK:     ProcEnd {
79 ; CHECK:     }
80 ; CHECK:   ]
82 ; ModuleID = 't.cpp'
83 source_filename = "t.cpp"
84 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
85 target triple = "i686-pc-windows-msvc19.0.23918"
87 @"\01?a@?1??f@@YAXXZ@3PAHA" = private unnamed_addr constant [5 x i32] [i32 9, i32 4, i32 5, i32 4, i32 2], align 4
89 define void @"\01?f@@YAXXZ"() #0 !dbg !6 {
90 entry:
91   %a = alloca [5 x i32], align 4
92   call void @llvm.dbg.declare(metadata [5 x i32]* %a, metadata !9, metadata !14), !dbg !15
93   %0 = bitcast [5 x i32]* %a to i8*, !dbg !15
94   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %0, i8* align 4 bitcast ([5 x i32]* @"\01?a@?1??f@@YAXXZ@3PAHA" to i8*), i32 20, i1 false), !dbg !15
95   %arraydecay = getelementptr inbounds [5 x i32], [5 x i32]* %a, i32 0, i32 0, !dbg !16
96   %arrayidx = getelementptr inbounds [5 x i32], [5 x i32]* %a, i32 0, i32 0, !dbg !17
97   %1 = load i32, i32* %arrayidx, align 4, !dbg !17
98   call void (i32, ...) @"\01?usevars@@YAXHZZ"(i32 %1, i32* %arraydecay), !dbg !18
99   ret void, !dbg !19
102 ; Function Attrs: nounwind readnone
103 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
105 ; Function Attrs: argmemonly nounwind
106 declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i1) #2
108 declare void @"\01?usevars@@YAXHZZ"(i32, ...) #3
110 attributes #0 = { "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"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
111 attributes #1 = { nounwind readnone }
112 attributes #2 = { argmemonly nounwind }
113 attributes #3 = { "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"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
115 !llvm.dbg.cu = !{!0}
116 !llvm.module.flags = !{!3, !4}
117 !llvm.ident = !{!5}
119 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
120 !1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cllvm\5Ctest\5CDebugInfo\5CCOFF")
121 !2 = !{}
122 !3 = !{i32 2, !"CodeView", i32 1}
123 !4 = !{i32 2, !"Debug Info Version", i32 3}
124 !5 = !{!"clang version 3.9.0 "}
125 !6 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAXXZ", scope: !1, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
126 !7 = !DISubroutineType(types: !8)
127 !8 = !{null}
128 !9 = !DILocalVariable(name: "a", scope: !6, file: !1, line: 3, type: !10)
129 !10 = !DICompositeType(tag: DW_TAG_array_type, baseType: !11, size: 160, align: 32, elements: !12)
130 !11 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
131 !12 = !{!13}
132 !13 = !DISubrange(count: 5)
133 !14 = !DIExpression()
134 !15 = !DILocation(line: 3, column: 7, scope: !6)
135 !16 = !DILocation(line: 4, column: 17, scope: !6)
136 !17 = !DILocation(line: 4, column: 11, scope: !6)
137 !18 = !DILocation(line: 4, column: 3, scope: !6)
138 !19 = !DILocation(line: 5, column: 1, scope: !6)