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