| 1 |
/* PR target/91188 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -masm=att" } */ |
| 4 |
/* { dg-additional-options "-mregparm=3" { target ia32 } } */ |
| 5 |
/* { dg-final { scan-assembler-not "movzwl" } } */ |
| 6 |
/* { dg-final { scan-assembler-not "movw" } } */ |
| 7 |
|
| 8 |
struct S |
| 9 |
{ |
| 10 |
unsigned short val; |
| 11 |
unsigned short pad; |
| 12 |
}; |
| 13 |
|
| 14 |
unsigned short b; |
| 15 |
|
| 16 |
struct S |
| 17 |
test_and (struct S a) |
| 18 |
{ |
| 19 |
a.val &= b; |
| 20 |
|
| 21 |
return a; |
| 22 |
} |
| 23 |
|
| 24 |
/* { dg-final { scan-assembler "\[ \t\]andw" } } */ |
| 25 |
|
| 26 |
struct S |
| 27 |
test_or (struct S a) |
| 28 |
{ |
| 29 |
a.val |= b; |
| 30 |
|
| 31 |
return a; |
| 32 |
} |
| 33 |
|
| 34 |
/* { dg-final { scan-assembler "\[ \t\]orw" } } */ |
| 35 |
|
| 36 |
struct S |
| 37 |
test_xor (struct S a) |
| 38 |
{ |
| 39 |
a.val ^= b; |
| 40 |
|
| 41 |
return a; |
| 42 |
} |
| 43 |
|
| 44 |
/* { dg-final { scan-assembler "\[ \t\]xorw" } } */ |
| 45 |
|
| 46 |
struct S |
| 47 |
test_add (struct S a) |
| 48 |
{ |
| 49 |
a.val += b; |
| 50 |
|
| 51 |
return a; |
| 52 |
} |
| 53 |
|
| 54 |
/* { dg-final { scan-assembler "\[ \t\]addw" } } */ |
| 55 |
|
| 56 |
struct S |
| 57 |
test_sub (struct S a) |
| 58 |
{ |
| 59 |
a.val -= b; |
| 60 |
|
| 61 |
return a; |
| 62 |
} |
| 63 |
|
| 64 |
/* { dg-final { scan-assembler "\[ \t\]subw" } } */ |