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 };
11
12 extern struct S1 t;
13
test_and(struct S1 a)14 struct S1 test_and (struct S1 a)
15 {
16 a.val &= t.val;
17
18 return a;
19 }
20
21 /* { dg-final { scan-assembler "\[ \t\]andb\[ \t\]+t\[^\n\r]*, %.h" } } */
22
test_or(struct S1 a)23 struct S1 test_or (struct S1 a)
24 {
25 a.val |= t.val;
26
27 return a;
28 }
29
30 /* { dg-final { scan-assembler "\[ \t\]orb\[ \t\]+t\[^\n\r]*, %.h" } } */
31
test_xor(struct S1 a)32 struct S1 test_xor (struct S1 a)
33 {
34 a.val ^= t.val;
35
36 return a;
37 }
38
39 /* { dg-final { scan-assembler "\[ \t\]xorb\[ \t\]+t\[^\n\r]*, %.h" } } */
40
test_add(struct S1 a)41 struct S1 test_add (struct S1 a)
42 {
43 a.val += t.val;
44
45 return a;
46 }
47
48 /* { dg-final { scan-assembler "\[ \t\]addb\[ \t\]+t\[^\n\r]*, %.h" } } */
49