Fortran: fix dependency checks for inquiry refs [PR115039]
[official-gcc.git] / gcc / testsuite / gcc.target / nios2 / cdx-logical.c
blobbf3819a819da164f770416ae9ce2605505e4f4f2
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -march=r2 -mcdx" } */
4 /* Check generation of R2 CDX and.n, andi.n, or.n, xor.n, and not.n
5 instructions.
7 and.n, or.n, and x.n require one of the input registers to be the same
8 as the output register. Since the tests below want to put the result
9 in the return value register, they use this function to make sure that
10 one of the input operands is also already in the return register. */
12 extern unsigned int x (unsigned int a);
14 unsigned int f (unsigned int a, unsigned int b)
16 return x (a) & b;
19 unsigned int g (unsigned int a)
21 return a & 31;
24 unsigned int h (unsigned int a, unsigned int b)
26 return x (a) | b;
29 unsigned int i (unsigned int a, unsigned int b)
31 return x (a) ^ b;
34 unsigned int j (unsigned int a)
36 return ~a;
39 /* { dg-final { scan-assembler "\tand\\.n\t.*" } } */
40 /* { dg-final { scan-assembler "\tandi\\.n\t.*, 31" } } */
41 /* { dg-final { scan-assembler "\tor\\.n\t.*" } } */
42 /* { dg-final { scan-assembler "\txor\\.n\t.*" } } */
43 /* { dg-final { scan-assembler "\tnot\\.n\t.*" } } */