source: src/Clight/test/null-op.c

Last change on this file was 776, checked in by campbell, 9 years ago

Fix up some minor null pointer issues in Clight.
Add corresponding Cminor example and fix up pretty printer a little.

File size: 235 bytes
Line 
1/* Check some operations with null are defined as expected. */
2
3int main(void) {
4  char c;
5  char *p = 0;
6  char *q = &c;
7
8  if (p == q) return 0;
9  if (p - p > 0) return 0;
10  p = p + 0;
11  p = 0 + p;
12  p = p - 0;
13
14  return (p == 0);
15}
Note: See TracBrowser for help on using the repository browser.