aboutsummaryrefslogtreecommitdiff
path: root/tcctest.c
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji _at_ gmail.com>2009-04-16 01:32:16 +0900
committergrischka <grischka>2009-04-18 15:08:01 +0200
commitbe43c8e0ed22faa6c89c6e551f2a07512673d60d (patch)
tree5383972d4823f2222a285b06628da84dbd382d88 /tcctest.c
parenta9c78d04f204049375567e9503ee1c4d50d1453f (diff)
downloadtinycc-be43c8e0ed22faa6c89c6e551f2a07512673d60d.tar.gz
tinycc-be43c8e0ed22faa6c89c6e551f2a07512673d60d.tar.bz2
x86-64: Cast from 64bit pointer to long long must not generate movslq.
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 */