| 1 |
/* PR 15184 first two tests, plus two addition ones. */ |
| 2 |
/* { dg-do compile { target ia32 } } */ |
| 3 |
/* { dg-options "-O2 -march=pentiumpro" } */ |
| 4 |
/* { dg-additional-options "-fno-PIE" { target ia32 } } */ |
| 5 |
|
| 6 |
#define regparm __attribute__((__regparm__(1))) |
| 7 |
|
| 8 |
extern unsigned int x; |
| 9 |
|
| 10 |
void regparm f0(unsigned char c) |
| 11 |
{ |
| 12 |
x = (x & 0xFFFFFF00) | (unsigned int)c; |
| 13 |
} |
| 14 |
|
| 15 |
void regparm f1(unsigned char c) |
| 16 |
{ |
| 17 |
x = (x & 0xFFFF00FF) | ((unsigned int)c << 8); |
| 18 |
} |
| 19 |
|
| 20 |
void regparm f2(unsigned char c) |
| 21 |
{ |
| 22 |
x = (x & 0xFF00FFFF) | ((unsigned int)c << 16); |
| 23 |
} |
| 24 |
void regparm f3(unsigned char c) |
| 25 |
{ |
| 26 |
x = (x & 0x00FFFFFF) | ((unsigned int)c << 24); |
| 27 |
} |
| 28 |
|
| 29 |
|
| 30 |
/* Each function should compile down to a byte move from |
| 31 |
the input register into x, possibly at an offset within x. */ |
| 32 |
/* { dg-final { scan-assembler-times "movb\[ \\t\]+%al" 4 } } */ |
| 33 |
|