1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-unk-unk -fno-limit-debug-info -o - -emit-llvm -g %s | FileCheck %s 2*f4a2713aSLionel Sambuc 3*f4a2713aSLionel Sambuc namespace rdar14101097_1 { // see also PR16214 4*f4a2713aSLionel Sambuc // Check that we emit debug info for the definition of a struct if the 5*f4a2713aSLionel Sambuc // definition is available, even if it's used via a pointer wrapped in a 6*f4a2713aSLionel Sambuc // typedef. 7*f4a2713aSLionel Sambuc // CHECK: [ DW_TAG_structure_type ] [foo] {{.*}}[def] 8*f4a2713aSLionel Sambuc struct foo { 9*f4a2713aSLionel Sambuc }; 10*f4a2713aSLionel Sambuc 11*f4a2713aSLionel Sambuc typedef foo *foop; 12*f4a2713aSLionel Sambuc 13*f4a2713aSLionel Sambuc void bar() { 14*f4a2713aSLionel Sambuc foop f; 15*f4a2713aSLionel Sambuc } 16*f4a2713aSLionel Sambuc } 17*f4a2713aSLionel Sambuc 18*f4a2713aSLionel Sambuc namespace rdar14101097_2 { 19*f4a2713aSLionel Sambuc // As above, except trickier because we first encounter only a declaration of 20*f4a2713aSLionel Sambuc // the type and no debug-info related use after we see the definition of the 21*f4a2713aSLionel Sambuc // type. 22*f4a2713aSLionel Sambuc // CHECK: [ DW_TAG_structure_type ] [foo] {{.*}}[def] 23*f4a2713aSLionel Sambuc struct foo; 24*f4a2713aSLionel Sambuc void bar() { 25*f4a2713aSLionel Sambuc foo *f; 26*f4a2713aSLionel Sambuc } 27*f4a2713aSLionel Sambuc struct foo { 28*f4a2713aSLionel Sambuc }; 29*f4a2713aSLionel Sambuc } 30*f4a2713aSLionel Sambuc 31