File: const.c

package info (click to toggle)
chibicc 1.0.23.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,832 kB
  • sloc: ansic: 62,911; sh: 275; makefile: 92
file content (14 lines) | stat: -rwxr-xr-x 292 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "test.h"

int main() {
  { const x; }
  { int const x; }
  { const int x; }
  { const int const const x; }
  ASSERT(5, ({ const x = 5; x; }));
  ASSERT(8, ({ const x = 8; int *const y=&x; *y; }));
  ASSERT(6, ({ const x = 6; *(const * const)&x; }));

  printf("OK\n");
  return 0;
}