1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
3
4 int test1(int x)
5 {
6 return !x;
7 }
8
9 int test2(int x)
10 {
11 return x ? 0 : 1;
12 }
13
14 int test3(int x)
15 {
16 return (x == 0) ? 1 : 0;
17 }
18
19 unsigned int test4(unsigned int x)
20 {
21 return !x;
22 }
23
24 unsigned int test5(unsigned int x)
25 {
26 return x ? 0 : 1;
27 }
28
29 unsigned int test6(unsigned int x)
30 {
31 return (x == 0) ? 1 : 0;
32 }
33
34 short test7(short x)
35 {
36 return !x;
37 }
38
39 short test8(short x)
40 {
41 return x ? 0 : 1;
42 }
43
44 short test9(short x)
45 {
46 return (x == 0) ? 1 : 0;
47 }
48
49 unsigned short test10(unsigned short x)
50 {
51 return !x;
52 }
53
54 unsigned short test11(unsigned short x)
55 {
56 return x ? 0 : 1;
57 }
58
59 unsigned short test12(unsigned short x)
60 {
61 return (x == 0) ? 1 : 0;
62 }
63
64 long test13(long x)
65 {
66 return !x;
67 }
68
69 long test14(long x)
70 {
71 return x ? 0 : 1;
72 }
73
74 long test15(long x)
75 {
76 return (x == 0) ? 1: 0;
77 }
78
79 unsigned long test16(unsigned long x)
80 {
81 return !x;
82 }
83
84 unsigned long test17(unsigned long x)
85 {
86 return x ? 0 : 1;
87 }
88
89 unsigned long test18(unsigned long x)
90 {
91 return (x == 0) ? 1 : 0;
92 }
93
94 /* { dg-final { scan-assembler-times "cnot.b" 18 } } */