shithub: scc

ref: 6e9d1522e50e81ab34916a0cf02fd838db7771c8
dir: /tests/cc/execute/0033-ptrindec.c/

View raw version
int
main()
{
	int arr[2];
	int *p;
	
	arr[0] = 2;
	arr[1] = 3;
	p = &arr[0];
	if(*(p++) != 2)
		return 1;
	if(*(p++) != 3)
		return 2;
	
	p = &arr[1];
	if(*(p--) != 3)
		return 1;
	if(*(p--) != 2)
		return 2;
		
	p = &arr[0];
	if(*(++p) != 3)
		return 1;
	
	p = &arr[1];
	if(*(--p) != 2)
		return 1;

	return 0;
}