Debian Codegraph @

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

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