| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O0 -gctf -dA" } */ |
| 3 |
|
| 4 |
/* This tests the following scenario: |
| 5 |
|
| 6 |
1. struct foo; |
| 7 |
2. struct foo *a_foo; |
| 8 |
3. struct foo { int bar; }; |
| 9 |
4. void baz (struct foo **f) { f->bar = 0; } |
| 10 |
|
| 11 |
At 2. a forward for struct foo is generated and at 3. the struct |
| 12 |
type is fully defined. When a pointer to a pointer to foo is |
| 13 |
encountered at 4., an additional CTF type for the completed struct |
| 14 |
shall be emitted as well. The linker will deduplicate both |
| 15 |
types. */ |
| 16 |
|
| 17 |
struct foo; |
| 18 |
struct foo *a_foo; |
| 19 |
struct foo { int bar; }; |
| 20 |
void baz (struct foo **f) { (*f)->bar = 0; } |
| 21 |
|
| 22 |
/* { dg-final { scan-assembler-times "\[\t \]\"bar.0\"\[\t \]+\[^\n\]*ctf_string" 1 } } */ |