blob: 52bffe6c928583bae479cbbf48765c0d227a7a95 [file] [log] [blame]
Douglas Katzman3459ce22015-10-08 04:24:12 +00001// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
Adrian Prantld45ba252014-02-25 19:38:11 +00002
3struct A
4{
Duncan P. N. Exon Smith9dd4e4e2015-04-29 16:40:08 +00005 // CHECK: !DISubprogram(name: "a", linkageName: "_ZN1A1aEiz"
Duncan P. N. Exon Smithf04be1f2015-03-03 17:25:55 +00006 // CHECK-SAME: line: [[@LINE+2]]
7 // CHECK-SAME: type: ![[ATY:[0-9]+]]
Adrian Prantld45ba252014-02-25 19:38:11 +00008 void a(int c, ...) {}
Duncan P. N. Exon Smith9dd4e4e2015-04-29 16:40:08 +00009 // CHECK: ![[ATY]] = !DISubroutineType(types: ![[AARGS:[0-9]+]])
Manman Ren264da422014-08-01 01:47:13 +000010 // We no longer use an explicit unspecified parameter. Instead we use a trailing null to mean the function is variadic.
Duncan P. N. Exon Smithb3a66692014-12-15 19:10:08 +000011 // CHECK: ![[AARGS]] = !{null, !{{[0-9]+}}, !{{[0-9]+}}, null}
Adrian Prantld45ba252014-02-25 19:38:11 +000012};
13
Duncan P. N. Exon Smith9dd4e4e2015-04-29 16:40:08 +000014 // CHECK: !DISubprogram(name: "b", linkageName: "_Z1biz"
Duncan P. N. Exon Smithf04be1f2015-03-03 17:25:55 +000015 // CHECK-SAME: line: [[@LINE+2]]
16 // CHECK-SAME: type: ![[BTY:[0-9]+]]
Adrian Prantld45ba252014-02-25 19:38:11 +000017void b(int c, ...) {
Duncan P. N. Exon Smith9dd4e4e2015-04-29 16:40:08 +000018 // CHECK: ![[BTY]] = !DISubroutineType(types: ![[BARGS:[0-9]+]])
Duncan P. N. Exon Smithb3a66692014-12-15 19:10:08 +000019 // CHECK: ![[BARGS]] = !{null, !{{[0-9]+}}, null}
Adrian Prantld45ba252014-02-25 19:38:11 +000020
21 A a;
22
Duncan P. N. Exon Smith38a7f112015-07-31 18:59:37 +000023 // CHECK: !DILocalVariable(name: "fptr"
Duncan P. N. Exon Smithf04be1f2015-03-03 17:25:55 +000024 // CHECK-SAME: line: [[@LINE+2]]
25 // CHECK-SAME: type: ![[PST:[0-9]+]]
Adrian Prantld45ba252014-02-25 19:38:11 +000026 void (*fptr)(int, ...) = b;
Duncan P. N. Exon Smith9dd4e4e2015-04-29 16:40:08 +000027 // CHECK: ![[PST]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: ![[BTY]],
Adrian Prantld45ba252014-02-25 19:38:11 +000028}