| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-mno-bwx -msafe-bwa" } */ |
| 3 |
/* { dg-skip-if "" { *-*-* } { "-O0" } } */ |
| 4 |
|
| 5 |
typedef union |
| 6 |
{ |
| 7 |
int i; |
| 8 |
char c; |
| 9 |
} |
| 10 |
char_a; |
| 11 |
|
| 12 |
void |
| 13 |
stba (char_a *p, char v) |
| 14 |
{ |
| 15 |
p->c = v; |
| 16 |
} |
| 17 |
|
| 18 |
/* Expect assembly such as: |
| 19 |
|
| 20 |
and $17,0xff,$17 |
| 21 |
$L2: |
| 22 |
ldl_l $1,0($16) |
| 23 |
bic $1,255,$1 |
| 24 |
bis $17,$1,$1 |
| 25 |
stl_c $1,0($16) |
| 26 |
beq $1,$L2 |
| 27 |
|
| 28 |
without any INSBL or MSKBL instructions and without address masking. */ |
| 29 |
|
| 30 |
/* { dg-final { scan-assembler-times "\\sldl_l\\s" 1 } } */ |
| 31 |
/* { dg-final { scan-assembler-times "\\sstl_c\\s" 1 } } */ |
| 32 |
/* { dg-final { scan-assembler-times "\\sand\\s\\\$\[0-9\]+,0xff,\\\$\[0-9\]+\\s" 1 } } */ |
| 33 |
/* { dg-final { scan-assembler-times "\\sbic\\s\\\$\[0-9\]+,255,\\\$\[0-9\]+\\s" 1 } } */ |
| 34 |
/* { dg-final { scan-assembler-not "\\sbic\\s\\\$\[0-9\]+,7,\\\$\[0-9\]+\\s" } } */ |
| 35 |
/* { dg-final { scan-assembler-not "\\s(?:insbl|mskbl)\\s" } } */ |