| 1 |
// { dg-do compile } |
| 2 |
// { dg-options "-O2" } |
| 3 |
/* Using -mshort-calls avoids loading the function addresses in |
| 4 |
registers and thus getting the counts wrong. */ |
| 5 |
// { dg-additional-options "-mshort-calls" {target epiphany-*-*} } |
| 6 |
// Using -mno-abicalls avoids a R_MIPS_JALR .reloc. |
| 7 |
// { dg-additional-options "-mno-abicalls" { target mips*-*-* } } |
| 8 |
// { dg-final { scan-assembler-times "xyzzy" 2 { target { ! { alpha*-*-* hppa*-*-* ia64*-*-hpux* sparc*-*-* *-*-mingw* } } } } } |
| 9 |
// For *-*-mingw* there is additionally one .def match |
| 10 |
// { dg-final { scan-assembler-times "xyzzy" 3 { target *-*-mingw* } } } |
| 11 |
// The IA64 and HPPA compilers generate external declarations in addition |
| 12 |
// to the call so those scans need to be more specific. |
| 13 |
// { dg-final { scan-assembler-times "br\[^\n\]*xyzzy" 2 { target ia64*-*-hpux* } } } |
| 14 |
// { dg-final { scan-assembler-times "xyzzy\[^\n\]*,%r" 2 { target hppa*-*-* } } } |
| 15 |
// If assembler supports explicit relocation directives, the alpha compiler generates |
| 16 |
// literal/lituse_jsr pairs, so the scans need to be more specific. |
| 17 |
// { dg-final { scan-assembler-times "jsr\[^\n\]*xyzzy" 2 { target alpha*-*-* } } } |
| 18 |
// Unless the assembler supports -relax, the 32-bit SPARC compiler generates |
| 19 |
// sethi/jmp instead of just call, so the scans need to be more specific. |
| 20 |
// { dg-final { scan-assembler-times "\(jmp|call\)\[^\n\]*xyzzy" 2 { target sparc*-*-* } } } |
| 21 |
|
| 22 |
struct S { S(); virtual void xyzzy(); }; |
| 23 |
struct R { int a; S s; R(); }; |
| 24 |
S s; |
| 25 |
R r; |
| 26 |
inline void foo(S *p) { p->xyzzy(); } |
| 27 |
void bar() {foo(&s);} |
| 28 |
void bah() {foo(&r.s);} |