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