xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/debug-info-fwd-ref.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin %s -o - | FileCheck %s
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc struct baz {
4*f4a2713aSLionel Sambuc     int h;
bazbaz5*f4a2713aSLionel Sambuc     baz(int a) : h(a) {}
6*f4a2713aSLionel Sambuc };
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc struct bar {
9*f4a2713aSLionel Sambuc     baz b;
10*f4a2713aSLionel Sambuc     baz& b_ref;
barbar11*f4a2713aSLionel Sambuc     bar(int x) : b(x), b_ref(b) {}
12*f4a2713aSLionel Sambuc };
13*f4a2713aSLionel Sambuc 
main(int argc,char ** argv)14*f4a2713aSLionel Sambuc int main(int argc, char** argv) {
15*f4a2713aSLionel Sambuc     bar myBar(1);
16*f4a2713aSLionel Sambuc     return 0;
17*f4a2713aSLionel Sambuc }
18*f4a2713aSLionel Sambuc 
19*f4a2713aSLionel Sambuc // Make sure we have two DW_TAG_structure_types for baz and bar and no forward
20*f4a2713aSLionel Sambuc // references.
21*f4a2713aSLionel Sambuc // CHECK-NOT: [fwd]
22*f4a2713aSLionel Sambuc // CHECK: [ DW_TAG_structure_type ] [bar]
23*f4a2713aSLionel Sambuc // CHECK: [ DW_TAG_structure_type ] [baz]
24*f4a2713aSLionel Sambuc // CHECK-NOT: [fwd]
25