• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
5 namespace 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]
10 struct foo {
11 };
12 
13 typedef foo *foop;
14 
bar()15 void bar() {
16   foop f;
17 }
18 }
19 
20 namespace 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]
25 struct foo;
bar()26 void bar() {
27   foo *f;
28 }
29 struct foo {
30 };
31 }
32 
33