| 1 |
/* PR target/78904 */ |
| 2 |
/* { dg-do compile { target { ! ia32 } } } */ |
| 3 |
/* { dg-options "-O2 -masm=att" } */ |
| 4 |
/* { dg-final { scan-assembler-not "movzbl" } } */ |
| 5 |
|
| 6 |
struct S1 |
| 7 |
{ |
| 8 |
unsigned char val; |
| 9 |
unsigned char pad1; |
| 10 |
unsigned short pad2; |
| 11 |
unsigned int pad3; |
| 12 |
}; |
| 13 |
|
| 14 |
struct S2 |
| 15 |
{ |
| 16 |
unsigned char pad1; |
| 17 |
unsigned char val; |
| 18 |
unsigned short pad2; |
| 19 |
unsigned int pad3; |
| 20 |
}; |
| 21 |
|
| 22 |
struct S1 test_and (struct S1 a, struct S2 b, struct S2 c) |
| 23 |
{ |
| 24 |
a.val = b.val & c.val; |
| 25 |
|
| 26 |
return a; |
| 27 |
} |
| 28 |
|
| 29 |
/* { dg-final { scan-assembler "\[ \t\]andb" } } */ |
| 30 |
|
| 31 |
struct S1 test_or (struct S1 a, struct S2 b, struct S2 c) |
| 32 |
{ |
| 33 |
a.val = b.val | c.val; |
| 34 |
|
| 35 |
return a; |
| 36 |
} |
| 37 |
|
| 38 |
/* { dg-final { scan-assembler "\[ \t\]orb" } } */ |
| 39 |
|
| 40 |
struct S1 test_xor (struct S1 a, struct S2 b, struct S2 c) |
| 41 |
{ |
| 42 |
a.val = b.val ^ c.val; |
| 43 |
|
| 44 |
return a; |
| 45 |
} |
| 46 |
|
| 47 |
/* { dg-final { scan-assembler "\[ \t\]xorb" } } */ |
| 48 |
|
| 49 |
struct S1 test_add (struct S1 a, struct S2 b, struct S2 c) |
| 50 |
{ |
| 51 |
a.val = b.val + c.val; |
| 52 |
|
| 53 |
return a; |
| 54 |
} |
| 55 |
|
| 56 |
/* { dg-final { scan-assembler "\[ \t\]addb" } } */ |
| 57 |
|
| 58 |
struct S1 test_sub (struct S1 a, struct S2 b, struct S2 c) |
| 59 |
{ |
| 60 |
a.val = b.val - c.val; |
| 61 |
|
| 62 |
return a; |
| 63 |
} |
| 64 |
|
| 65 |
/* { dg-final { scan-assembler "\[ \t\]subb" } } */ |