1 /* -*-comment-start: "//";comment-end:""-*-
2 * Mes --- Maxwell Equations of Software
3 * Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org>
5 * This file is part of Mes.
7 * Mes is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or (at
10 * your option) any later version.
12 * Mes is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Mes. If not, see <http://www.gnu.org/licenses/>.
50 puts ("t: -1 < -2\n");
51 if (-1 < -2) return 1;
62 puts ("t: -2 > -1\n");
63 if (-2 > -1) return 1;
68 puts ("t: 1 == inc (0)\n");
69 if (1 == inc (0)) goto ok0;
73 puts ("t: 0 < inc (0)\n");
74 if (0 < inc (0)) goto ok1;
78 puts ("t: inc (0) + 2 != 3\n");
79 if (inc (0) + inc (1) != 3) return 1;
100 puts ("t: 1 << 3\n");
101 if (1 << 3 != 8) return 1 << 3;
103 puts ("t: 3 << 4\n");
104 if (3 << 4 != 48) return 3 << 4;
106 puts ("t: 48 >> 3\n");
107 if (48 >> 4 != 3) return 48 >> 4;
109 puts ("t: 10 >> 1\n");
110 if (10 >> 1 != 5) return 10 >> 1;
113 if ((1 | 4) != 5) return 1 | 4;
117 if (-i != 3) return 1;
119 puts ("t: -1 + 2\n");
120 if (-1 + 2 != 1) return 1;
123 if ((1 & 3) != 1) return 1;
126 if (~0 != -1) return 1;
129 if ((1 | 2) != 3) return 1;
132 if ((1 ^ 3) != 2) return 1;
134 puts ("t: 3 == 3\n");
135 if ((3 == 3) != 1) return 1;
137 puts ("t: 3 != 3\n");
138 if ((3 != 3) != 0) return 1;
140 puts ("t: 011 == 15\n");
141 if (011 != 9) return 1;
143 puts ("t: 0b11 == 3\n");
144 if (0b11 != 3) return 1;
146 puts ("t: 0x11 == 3\n");
147 if (0x11 != 17) return 1;