Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.c-torture/execute/20040409-1.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
10 unsigned int test1u(unsigned int x) | 10 unsigned int test1u(unsigned int x) |
11 { | 11 { |
12 return x ^ (unsigned int)INT_MIN; | 12 return x ^ (unsigned int)INT_MIN; |
13 } | 13 } |
14 | 14 |
15 int test2(int x) | |
16 { | |
17 return x + INT_MIN; | |
18 } | |
19 | |
20 unsigned int test2u(unsigned int x) | 15 unsigned int test2u(unsigned int x) |
21 { | 16 { |
22 return x + (unsigned int)INT_MIN; | 17 return x + (unsigned int)INT_MIN; |
23 } | |
24 | |
25 int test3(int x) | |
26 { | |
27 return x - INT_MIN; | |
28 } | 18 } |
29 | 19 |
30 unsigned int test3u(unsigned int x) | 20 unsigned int test3u(unsigned int x) |
31 { | 21 { |
32 return x - (unsigned int)INT_MIN; | 22 return x - (unsigned int)INT_MIN; |
42 { | 32 { |
43 unsigned int y = (unsigned int)INT_MIN; | 33 unsigned int y = (unsigned int)INT_MIN; |
44 return x ^ y; | 34 return x ^ y; |
45 } | 35 } |
46 | 36 |
47 int test5(int x) | |
48 { | |
49 int y = INT_MIN; | |
50 return x + y; | |
51 } | |
52 | |
53 unsigned int test5u(unsigned int x) | 37 unsigned int test5u(unsigned int x) |
54 { | 38 { |
55 unsigned int y = (unsigned int)INT_MIN; | 39 unsigned int y = (unsigned int)INT_MIN; |
56 return x + y; | 40 return x + y; |
57 } | |
58 | |
59 int test6(int x) | |
60 { | |
61 int y = INT_MIN; | |
62 return x - y; | |
63 } | 41 } |
64 | 42 |
65 unsigned int test6u(unsigned int x) | 43 unsigned int test6u(unsigned int x) |
66 { | 44 { |
67 unsigned int y = (unsigned int)INT_MIN; | 45 unsigned int y = (unsigned int)INT_MIN; |
72 | 50 |
73 void test(int a, int b) | 51 void test(int a, int b) |
74 { | 52 { |
75 if (test1(a) != b) | 53 if (test1(a) != b) |
76 abort(); | 54 abort(); |
77 if (test2(a) != b) | |
78 abort(); | |
79 if (test3(a) != b) | |
80 abort(); | |
81 if (test4(a) != b) | 55 if (test4(a) != b) |
82 abort(); | |
83 if (test5(a) != b) | |
84 abort(); | |
85 if (test6(a) != b) | |
86 abort(); | 56 abort(); |
87 } | 57 } |
88 | 58 |
89 void testu(unsigned int a, unsigned int b) | 59 void testu(unsigned int a, unsigned int b) |
90 { | 60 { |