aboutsummaryrefslogtreecommitdiff
path: root/tcctest.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcctest.c')
-rw-r--r--tcctest.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tcctest.c b/tcctest.c
index be47c90..8ef322e 100644
--- a/tcctest.c
+++ b/tcctest.c
@@ -1109,6 +1109,8 @@ void cast_test()
char tab[10];
unsigned b,d;
short s;
+ char *p = NULL;
+ p -= 0x700000000042;
printf("cast_test:\n");
a = 0xfffff;
@@ -1150,6 +1152,14 @@ void cast_test()
printf("sizeof(+(char)'a') = %d\n", sizeof(+(char)'a'));
printf("sizeof(-(char)'a') = %d\n", sizeof(-(char)'a'));
printf("sizeof(~(char)'a') = %d\n", sizeof(-(char)'a'));
+
+ /* from pointer to integer types */
+ printf("%d %d %d %d %d %d %ld %ld %lld %lld\n",
+ (char)p, (unsigned char)p,
+ (short)p, (unsigned short)p,
+ (int)p, (unsigned int)p,
+ (long)p, (unsigned long)p,
+ (long long)p, (unsigned long long)p);
}
/* initializers tests */