Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr78904-7a.c

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