Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / test / DebugInfo / COFF / types-cvarargs.ll
blob5e366f0e981f97c830ac7de4c65e630c2542898c
1 ; RUN: llc < %s -filetype=obj | llvm-readobj - -codeview | FileCheck %s
3 ; C++ source to regenerate:
4 ; $ cat t.cpp
5 ; typedef void (*FuncTypedef)(int, float, ...);
6 ; FuncTypedef funcVar;
7 ; namespace MemberTest {
8 ;   class A {
9 ;   public:
10 ;     int MemberFunc(...) { return 1; }
11 ;   };
12 ; }
13 ; int f () {
14 ;   MemberTest::A v1;
15 ;   v1.MemberFunc(1,20,0);
16 ;   return 1;
17 ; }
18 ; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll
20 ; CHECK:  MemberFuncId (0x100B) {
21 ; CHECK:    TypeLeafKind: LF_MFUNC_ID (0x1602)
22 ; CHECK:    ClassType: MemberTest::A (0x1003)
23 ; CHECK:    FunctionType: int MemberTest::A::(<no type>) (0x1006)
24 ; CHECK:    Name: MemberFunc
25 ; CHECK:  }
26 ; CHECK:  Subsection [
27 ; CHECK:    SubSectionType: Symbols (0xF1)
28 ; CHECK:    SubSectionSize:
29 ; CHECK:    UDTSym {
30 ; CHECK:      Kind: S_UDT (0x1108)
31 ; CHECK:      Type: MemberTest::A (0x1008)
32 ; CHECK:      UDTName: MemberTest::A
33 ; CHECK:    }
34 ; CHECK:    UDTSym {
35 ; CHECK:      Kind: S_UDT (0x1108)
36 ; CHECK:      Type: void (int, float, <no type>)* (0x100F)
37 ; CHECK:      UDTName: FuncTypedef
38 ; CHECK:    }
39 ; CHECK:  ]
41 ; ModuleID = 't.cpp'
42 source_filename = "t.cpp"
43 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
44 target triple = "x86_64-pc-windows-msvc19.11.25507"
46 %"class.MemberTest::A" = type { i8 }
48 $"\01?MemberFunc@A@MemberTest@@QEAAHZZ" = comdat any
50 @"\01?funcVar@@3P6AXHMZZEA" = global void (i32, float, ...)* null, align 8, !dbg !0
52 ; Function Attrs: noinline optnone uwtable
53 define i32 @"\01?f@@YAHXZ"() #0 !dbg !17 {
54 entry:
55   %v1 = alloca %"class.MemberTest::A", align 1
56   call void @llvm.dbg.declare(metadata %"class.MemberTest::A"* %v1, metadata !20, metadata !DIExpression()), !dbg !28
57   %call = call i32 (%"class.MemberTest::A"*, ...) @"\01?MemberFunc@A@MemberTest@@QEAAHZZ"(%"class.MemberTest::A"* %v1, i32 1, i32 20, i64 0), !dbg !29
58   ret i32 1, !dbg !30
61 ; Function Attrs: nounwind readnone speculatable
62 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
64 ; Function Attrs: noinline nounwind optnone uwtable
65 define linkonce_odr i32 @"\01?MemberFunc@A@MemberTest@@QEAAHZZ"(%"class.MemberTest::A"* %this, ...) #2 comdat align 2 !dbg !31 {
66 entry:
67   %this.addr = alloca %"class.MemberTest::A"*, align 8
68   store %"class.MemberTest::A"* %this, %"class.MemberTest::A"** %this.addr, align 8
69   call void @llvm.dbg.declare(metadata %"class.MemberTest::A"** %this.addr, metadata !32, metadata !DIExpression()), !dbg !34
70   %this1 = load %"class.MemberTest::A"*, %"class.MemberTest::A"** %this.addr, align 8
71   ret i32 1, !dbg !35
74 attributes #0 = { noinline optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
75 attributes #1 = { nounwind readnone speculatable }
76 attributes #2 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
78 !llvm.dbg.cu = !{!2}
79 !llvm.module.flags = !{!12, !13, !14, !15}
80 !llvm.ident = !{!16}
82 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
83 !1 = distinct !DIGlobalVariable(name: "funcVar", linkageName: "\01?funcVar@@3P6AXHMZZEA", scope: !2, file: !3, line: 4, type: !6, isLocal: false, isDefinition: true)
84 !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 7.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
85 !3 = !DIFile(filename: "t.cpp", directory: "D:\5Cupstream\5Cllvm\5Ctest\5CDebugInfo\5CCOFF", checksumkind: CSK_MD5, checksum: "d6582aff49f975763b736524db75f999")
86 !4 = !{}
87 !5 = !{!0}
88 !6 = !DIDerivedType(tag: DW_TAG_typedef, name: "FuncTypedef", file: !3, line: 3, baseType: !7)
89 !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64)
90 !8 = !DISubroutineType(types: !9)
91 !9 = !{null, !10, !11, null}
92 !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
93 !11 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)
94 !12 = !{i32 2, !"CodeView", i32 1}
95 !13 = !{i32 2, !"Debug Info Version", i32 3}
96 !14 = !{i32 1, !"wchar_size", i32 2}
97 !15 = !{i32 7, !"PIC Level", i32 2}
98 !16 = !{!"clang version 7.0.0 "}
99 !17 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAHXZ", scope: !3, file: !3, line: 11, type: !18, isLocal: false, isDefinition: true, scopeLine: 11, flags: DIFlagPrototyped, isOptimized: false, unit: !2, retainedNodes: !4)
100 !18 = !DISubroutineType(types: !19)
101 !19 = !{!10}
102 !20 = !DILocalVariable(name: "v1", scope: !17, file: !3, line: 12, type: !21)
103 !21 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "A", scope: !22, file: !3, line: 6, size: 8, elements: !23, identifier: ".?AVA@MemberTest@@")
104 !22 = !DINamespace(name: "MemberTest", scope: null)
105 !23 = !{!24}
106 !24 = !DISubprogram(name: "MemberFunc", linkageName: "\01?MemberFunc@A@MemberTest@@QEAAHZZ", scope: !21, file: !3, line: 8, type: !25, isLocal: false, isDefinition: false, scopeLine: 8, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false)
107 !25 = !DISubroutineType(types: !26)
108 !26 = !{!10, !27, null}
109 !27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !21, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
110 !28 = !DILocation(line: 12, column: 18, scope: !17)
111 !29 = !DILocation(line: 13, column: 7, scope: !17)
112 !30 = !DILocation(line: 14, column: 4, scope: !17)
113 !31 = distinct !DISubprogram(name: "MemberFunc", linkageName: "\01?MemberFunc@A@MemberTest@@QEAAHZZ", scope: !21, file: !3, line: 8, type: !25, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: false, unit: !2, declaration: !24, retainedNodes: !4)
114 !32 = !DILocalVariable(name: "this", arg: 1, scope: !31, type: !33, flags: DIFlagArtificial | DIFlagObjectPointer)
115 !33 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !21, size: 64)
116 !34 = !DILocation(line: 0, scope: !31)
117 !35 = !DILocation(line: 8, column: 28, scope: !31)