| 1 |
/* { dg-do compile { target { arm32 } } } */ |
| 2 |
/* { dg-options "-O2" } */ |
| 3 |
/* { dg-skip-if "FDPIC does not support sibcall optimization" { arm*-*-uclinuxfdpiceabi } "*" "" } */ |
| 4 |
|
| 5 |
#define noinline __attribute__((noinline)) |
| 6 |
|
| 7 |
typedef struct { |
| 8 |
int data[4]; |
| 9 |
} arr16_t; |
| 10 |
|
| 11 |
int result = 0; |
| 12 |
|
| 13 |
void noinline func2 (int i, int j, arr16_t arr) |
| 14 |
{ |
| 15 |
result = (arr.data[0] != 1 |
| 16 |
|| arr.data[1] != 2 |
| 17 |
|| arr.data[2] != 3 |
| 18 |
|| arr.data[3] != 4); |
| 19 |
} |
| 20 |
|
| 21 |
void func1 (int i, int j, int k, int l, int m, int n, arr16_t a) |
| 22 |
{ |
| 23 |
func2(i, j, a); |
| 24 |
} |
| 25 |
|
| 26 |
int main(int argc, const char *argv[]) |
| 27 |
{ |
| 28 |
arr16_t arr = {{1, 2, 3, 4}}; |
| 29 |
|
| 30 |
func1(0, 0, 0, 0, 0, 0, arr); |
| 31 |
return result; |
| 32 |
} |
| 33 |
|
| 34 |
/* The PLT marker may appear if the test is run with -fpic/-fPIC. */ |
| 35 |
/* { dg-final { scan-assembler "\tb\tfunc2(\\(PLT\\))?\n" } } */ |
| 36 |
|