[committed] [RISC-V] Fix wrong patch application
[official-gcc.git] / gcc / testsuite / gcc.target / rx / pr83831.c
blob27d4a89cff4d238705df43698e085daf1df9fd83
1 /* { dg-do compile } */
2 /* { dg-options "-O1" } */
3 /* { dg-final { scan-assembler-times "bclr" 6 } } */
4 /* { dg-final { scan-assembler-times "bset" 7 } } */
5 /* { dg-final { scan-assembler-times "bnot" 7 } } */
7 void
8 test_0 (char* x, unsigned int y)
10 /* Expect 4x bclr here. */
11 x[0] &= 0xFE;
12 x[1] = y & ~(1 << 1);
13 x[2] &= 0xFE;
14 x[65000] &= 0xFE;
17 unsigned int
18 test_1 (unsigned int x, unsigned int y)
20 /* Expect 1x bclr here. */
21 return x & ~(1 << y);
24 unsigned int
25 test_2 (unsigned int x)
27 /* Expect 1x bclr here. */
28 return x & ~(1 << 1);
31 void
32 test_3 (char* x, unsigned int y, unsigned int z)
34 /* Expect 5x bset here. */
35 x[0] |= 0x10;
36 x[1] = y | (1 << 1);
37 x[2] |= 0x10;
38 x[65000] |= 0x10;
39 x[5] |= 1 << z;
42 unsigned int
43 test_4 (unsigned int x, unsigned int y)
45 /* Expect 1x bset here. */
46 return x | (1 << y);
49 unsigned int
50 test_5 (unsigned int x)
52 /* Expect 1x bset here. */
53 return x | (1 << 8);
56 void
57 test_6 (char* x, unsigned int y, unsigned int z)
59 /* Expect 5x bnot here. */
60 x[0] ^= 0x10;
61 x[1] = y ^ (1 << 1);
62 x[2] ^= 0x10;
63 x[65000] ^= 0x10;
64 x[5] ^= 1 << z;
67 unsigned int
68 test_7 (unsigned int x, unsigned int y)
70 /* Expect 1x bnot here. */
71 return x ^ (1 << y);
74 unsigned int
75 test_8 (unsigned int x)
77 /* Expect 1x bnot here. */
78 return x ^ (1 << 8);