1 /* Problem noticed on SH for DImode comparison with constants. 2 /* { dg-do run } */ 3 /* { dg-options "-O0" } */ 4 5 extern void abort(void); 6 extern void exit(int); 7 test2(long long n)8int test2(long long n) 9 { 10 if (n < 2) 11 return 1; 12 return 0; 13 } 14 test1(long long n)15int test1(long long n) 16 { 17 if (n < 1) 18 return 1; 19 return 0; 20 } 21 test0(long long n)22int test0(long long n) 23 { 24 if (n < 0) 25 return 1; 26 return 0; 27 } 28 test1n(long long n)29int test1n(long long n) 30 { 31 if (n < -1LL) 32 return 1; 33 return 0; 34 } 35 test2n(long long n)36int test2n(long long n) 37 { 38 if (n < -2LL) 39 return 1; 40 return 0; 41 } 42 main()43int main() 44 { 45 if (test2n (-1LL)) 46 abort (); 47 48 if (test2n (-2LL)) 49 abort (); 50 51 if (test2n (0LL)) 52 abort (); 53 54 if (test2n (1LL)) 55 abort (); 56 57 if (test2n (2LL)) 58 abort (); 59 60 if (test1n (-1LL)) 61 abort (); 62 63 if (!test1n (-2LL)) 64 abort (); 65 66 if (test1n (0LL)) 67 abort (); 68 69 if (test1n (1LL)) 70 abort (); 71 72 if (test1n (2LL)) 73 abort (); 74 75 if (!test0 (-1LL)) 76 abort (); 77 78 if (!test0 (-2LL)) 79 abort (); 80 81 if (test0 (0LL)) 82 abort (); 83 84 if (test0 (1LL)) 85 abort (); 86 87 if (test0 (2LL)) 88 abort (); 89 90 if (!test2 (-1LL)) 91 abort (); 92 93 if (!test2 (-2LL)) 94 abort (); 95 96 if (!test2 (0LL)) 97 abort (); 98 99 if (!test2 (1LL)) 100 abort (); 101 102 if (test2 (2LL)) 103 abort (); 104 105 if (!test1 (-1LL)) 106 abort (); 107 108 if (!test1 (-2LL)) 109 abort (); 110 111 if (!test1 (0LL)) 112 abort (); 113 114 if (test1 (1LL)) 115 abort (); 116 117 if (test1 (2LL)) 118 abort (); 119 120 exit (0); 121 } 122 123 124 125