Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr91188-2a.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 "movzwl" } } */
6 /* { dg-final { scan-assembler-not "movw" } } */
7
8 struct S
9 {
10 unsigned short val;
11 unsigned short pad;
12 };
13
14 struct S
15 test_and (struct S a, unsigned short b)
16 {
17 a.val &= b;
18
19 return a;
20 }
21
22 /* { dg-final { scan-assembler "\[ \t\]andw" } } */
23
24 struct S
25 test_or (struct S a, unsigned short b)
26 {
27 a.val |= b;
28
29 return a;
30 }
31
32 /* { dg-final { scan-assembler "\[ \t\]orw" } } */
33
34 struct S
35 test_xor (struct S a, unsigned short b)
36 {
37 a.val ^= b;
38
39 return a;
40 }
41
42 /* { dg-final { scan-assembler "\[ \t\]xorw" } } */
43
44 struct S
45 test_add (struct S a, unsigned short b)
46 {
47 a.val += b;
48
49 return a;
50 }
51
52 /* { dg-final { scan-assembler "\[ \t\]addw" } } */
53
54 struct S
55 test_sub (struct S a, unsigned short b)
56 {
57 a.val -= b;
58
59 return a;
60 }
61
62 /* { dg-final { scan-assembler "\[ \t\]subw" } } */