Debian Codegraph @

gcc/testsuite/gcc.target/riscv/zicond-primitiveSemantics_compare_imm.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=rv64gc_zicond -mabi=lp64d" { target { rv64 } } } */
3 /* { dg-options "-march=rv32gc_zicond -mabi=ilp32f" { target { rv32 } } } */
4 /* { dg-skip-if "" { *-*-* } {"-O0" "-Og" "-Os" "-Oz"} } */
5
6 long primitiveSemantics_compare_imm_00(long a, long b) {
7 return a == 2 ? 0 : b;
8 }
9
10 long primitiveSemantics_compare_imm_01(long a, long b) {
11 return a != 2 ? 0 : b;
12 }
13
14 long primitiveSemantics_compare_imm_02(long a, long b) {
15 return a == 2 ? b : 0;
16 }
17
18 long primitiveSemantics_compare_imm_03(long a, long b) {
19 return a != 2 ? b : 0;
20 }
21
22 long primitiveSemantics_compare_imm_04(long a, long b) {
23 if (a == 2)
24 b = 0;
25 return b;
26 }
27
28 long primitiveSemantics_compare_imm_05(long a, long b) {
29 if (!(a == 2))
30 b = 0;
31 return b;
32 }
33
34 int primitiveSemantics_compare_imm_06(int a, int b) { return a == 2 ? 0 : b; }
35
36 int primitiveSemantics_compare_imm_07(int a, int b) { return a != 2 ? 0 : b; }
37
38 int primitiveSemantics_compare_imm_08(int a, int b) { return a == 2 ? b : 0; }
39
40 int primitiveSemantics_compare_imm_09(int a, int b) { return a != 2 ? b : 0; }
41
42 int primitiveSemantics_compare_imm_10(int a, int b) {
43 if ((a == 2))
44 b = 0;
45 return b;
46 }
47
48 int primitiveSemantics_compare_imm_11(int a, int b) {
49 if (!(a == 2))
50 b = 0;
51 return b;
52 }
53
54 /* { dg-final { scan-assembler-times {\mczero.eqz\M} 6 } } */
55 /* { dg-final { scan-assembler-times {\mczero.nez\M} 6 } } */
56 /* { dg-final { scan-assembler-not {\mbeq\M} } } */
57 /* { dg-final { scan-assembler-not {\mbne\M} } } */