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