blob: 126e1f6bd1b8fe2530e71d3bd37064f171169995 [file] [log] [blame]
Douglas Katzman3459ce22015-10-08 04:24:12 +00001// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple x86_64-apple-darwin %s -o - | FileCheck %s
Adrian Prantlefb88052014-04-01 17:52:06 +00002//
3// Test that indirect field decls are handled gracefully.
4// rdar://problem/16348575
5//
6template <class T, int T::*ptr> class Foo { };
7
8struct Bar {
9 int i1;
Duncan P. N. Exon Smith9dd4e4e2015-04-29 16:40:08 +000010 // CHECK: ![[INT:[0-9]+]] = !DIBasicType(name: "int"
Adrian McCarthy20128d92016-07-06 23:28:34 +000011 // CHECK: !DIDerivedType(tag: DW_TAG_member, scope:
12 // CHECK-SAME: line: [[@LINE+4]]
13 // CHECK-SAME: baseType: ![[UNION:[0-9]+]]
Victor Leschuka7ece032016-10-20 00:13:19 +000014 // CHECK-SAME: size: 32, offset: 32
Adrian McCarthy20128d92016-07-06 23:28:34 +000015 // CHECK: ![[UNION]] = distinct !DICompositeType(tag: DW_TAG_union_type,{{.*}} identifier: "_ZTSN3BarUt_E")
Adrian Prantlefb88052014-04-01 17:52:06 +000016 union {
Duncan P. N. Exon Smith9dd4e4e2015-04-29 16:40:08 +000017 // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "i2",
Adrian McCarthy20128d92016-07-06 23:28:34 +000018 // CHECK-SAME: line: [[@LINE+5]]
Duncan P. N. Exon Smithf04be1f2015-03-03 17:25:55 +000019 // CHECK-SAME: baseType: ![[INT]]
Victor Leschuka7ece032016-10-20 00:13:19 +000020 // CHECK-SAME: size: 32
Duncan P. N. Exon Smithf04be1f2015-03-03 17:25:55 +000021 // CHECK-NOT: offset:
22 // CHECK-SAME: ){{$}}
Adrian Prantlefb88052014-04-01 17:52:06 +000023 int i2;
24 };
25};
26
27Foo<Bar, &Bar::i2> the_foo;