| 1 |
// PR target/101023 |
| 2 |
// { dg-do run { target { ! ia32 } } } |
| 3 |
// { dg-options "-O2 -mtune=opteron -mstackrealign --param=hot-bb-frequency-fraction=1" } |
| 4 |
|
| 5 |
struct S { |
| 6 |
__attribute__((noipa)) int m1 (); |
| 7 |
__attribute__((noipa)) void m2 (); |
| 8 |
}; |
| 9 |
struct T { |
| 10 |
__attribute__((noipa)) virtual S m3 (); |
| 11 |
}; |
| 12 |
struct U : T { |
| 13 |
int u; |
| 14 |
__attribute__((noipa)) U (int); |
| 15 |
}; |
| 16 |
int *a; |
| 17 |
S *b; |
| 18 |
int c; |
| 19 |
|
| 20 |
int |
| 21 |
S::m1 () |
| 22 |
{ |
| 23 |
return 0; |
| 24 |
} |
| 25 |
|
| 26 |
void |
| 27 |
S::m2 () |
| 28 |
{ |
| 29 |
} |
| 30 |
|
| 31 |
S |
| 32 |
T::m3 () |
| 33 |
{ |
| 34 |
return S (); |
| 35 |
} |
| 36 |
|
| 37 |
U::U (int) : u (4) |
| 38 |
{ |
| 39 |
} |
| 40 |
|
| 41 |
__attribute__((noipa)) int |
| 42 |
foo () |
| 43 |
{ |
| 44 |
if (a) |
| 45 |
return 0; |
| 46 |
U d(c); |
| 47 |
S *e = b; |
| 48 |
e->m2 (); |
| 49 |
return e->m1(); |
| 50 |
} |
| 51 |
|
| 52 |
int |
| 53 |
main () |
| 54 |
{ |
| 55 |
register int r12 __asm ("r12") = 1; |
| 56 |
register int rax __asm ("rax") = 2; |
| 57 |
asm volatile ("" : "+r" (r12), "+r" (rax)); |
| 58 |
foo (); |
| 59 |
asm volatile ("" : "+r" (r12)); |
| 60 |
if (r12 != 1) |
| 61 |
__builtin_abort (); |
| 62 |
return 0; |
| 63 |
} |