| 1 |
/* PR target/78904 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -masm=att" } */ |
| 4 |
/* { dg-additional-options "-mregparm=3" { target ia32 } } */ |
| 5 |
/* { dg-final { scan-assembler-not "shr" } } */ |
| 6 |
|
| 7 |
struct S1 |
| 8 |
{ |
| 9 |
unsigned char pad1; |
| 10 |
unsigned char val; |
| 11 |
unsigned short pad2; |
| 12 |
}; |
| 13 |
|
| 14 |
char test_and (struct S1 a, struct S1 b) |
| 15 |
{ |
| 16 |
return a.val & b.val; |
| 17 |
} |
| 18 |
|
| 19 |
/* { dg-final { scan-assembler "\[ \t\]andb" } } */ |
| 20 |
|
| 21 |
char test_or (struct S1 a, struct S1 b) |
| 22 |
{ |
| 23 |
return a.val | b.val; |
| 24 |
} |
| 25 |
|
| 26 |
/* { dg-final { scan-assembler "\[ \t\]orb" } } */ |
| 27 |
|
| 28 |
char test_xor (struct S1 a, struct S1 b) |
| 29 |
{ |
| 30 |
return a.val ^ b.val; |
| 31 |
} |
| 32 |
|
| 33 |
/* { dg-final { scan-assembler "\[ \t\]xorb" } } */ |
| 34 |
|
| 35 |
char test_add (struct S1 a, struct S1 b) |
| 36 |
{ |
| 37 |
return a.val + b.val; |
| 38 |
} |
| 39 |
|
| 40 |
/* { dg-final { scan-assembler "\[ \t\]addb" } } */ |
| 41 |
|
| 42 |
char test_sub (struct S1 a, struct S1 b) |
| 43 |
{ |
| 44 |
return a.val - b.val; |
| 45 |
} |
| 46 |
|
| 47 |
/* { dg-final { scan-assembler "\[ \t\]subb" } } */ |