2008-05-30 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / long-long-compare-1.c
blobc650cb18d2b839a99c11ef8b22ae1b981ae7d9e8
1 /* Problem only noticed on SH for -mcbranchdi DImode comparison with constants.
2 * Target dependant failure but test valid for alls. */
3 /* { dg-do run } */
4 /* { dg-options "-O0" } */
5 /* { dg-options "-O0 -mcbranchdi" { target sh4-*-* } } */
7 extern void abort(void);
8 extern void exit(int);
10 int test2(long long n)
12 if (n < 2)
13 return 1;
14 return 0;
17 int test1(long long n)
19 if (n < 1)
20 return 1;
21 return 0;
24 int test0(long long n)
26 if (n < 0)
27 return 1;
28 return 0;
31 int test1n(long long n)
33 if (n < -1LL)
34 return 1;
35 return 0;
38 int test2n(long long n)
40 if (n < -2LL)
41 return 1;
42 return 0;
45 int main()
47 if (test2n (-1LL))
48 abort ();
50 if (test2n (-2LL))
51 abort ();
53 if (test2n (0LL))
54 abort ();
56 if (test2n (1LL))
57 abort ();
59 if (test2n (2LL))
60 abort ();
62 if (test1n (-1LL))
63 abort ();
65 if (!test1n (-2LL))
66 abort ();
68 if (test1n (0LL))
69 abort ();
71 if (test1n (1LL))
72 abort ();
74 if (test1n (2LL))
75 abort ();
77 if (!test0 (-1LL))
78 abort ();
80 if (!test0 (-2LL))
81 abort ();
83 if (test0 (0LL))
84 abort ();
86 if (test0 (1LL))
87 abort ();
89 if (test0 (2LL))
90 abort ();
92 if (!test2 (-1LL))
93 abort ();
95 if (!test2 (-2LL))
96 abort ();
98 if (!test2 (0LL))
99 abort ();
101 if (!test2 (1LL))
102 abort ();
104 if (test2 (2LL))
105 abort ();
107 if (!test1 (-1LL))
108 abort ();
110 if (!test1 (-2LL))
111 abort ();
113 if (!test1 (0LL))
114 abort ();
116 if (test1 (1LL))
117 abort ();
119 if (test1 (2LL))
120 abort ();
122 exit (0);