Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr91188-1a.c

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