mirror of
https://github.com/frida/tinycc
synced 2024-12-26 06:56:49 +03:00
conversion test
This commit is contained in:
parent
365d0ad545
commit
65b974e396
10
tcctest.c
10
tcctest.c
@ -1073,6 +1073,8 @@ void cast_test()
|
|||||||
int a;
|
int a;
|
||||||
char c;
|
char c;
|
||||||
char tab[10];
|
char tab[10];
|
||||||
|
unsigned b,d;
|
||||||
|
short s;
|
||||||
|
|
||||||
printf("cast_test:\n");
|
printf("cast_test:\n");
|
||||||
a = 0xfffff;
|
a = 0xfffff;
|
||||||
@ -1096,6 +1098,14 @@ void cast_test()
|
|||||||
|
|
||||||
printf("sizeof(c) = %d, sizeof((int)c) = %d\n", sizeof(c), sizeof((int)c));
|
printf("sizeof(c) = %d, sizeof((int)c) = %d\n", sizeof(c), sizeof((int)c));
|
||||||
|
|
||||||
|
/* test cast from unsigned to signed short to int */
|
||||||
|
b = 0xf000;
|
||||||
|
d = (short)b;
|
||||||
|
printf("((unsigned)(short)0x%08x) = 0x%08x\n", b, d);
|
||||||
|
b = 0xf0f0;
|
||||||
|
d = (char)b;
|
||||||
|
printf("((unsigned)(char)0x%08x) = 0x%08x\n", b, d);
|
||||||
|
|
||||||
/* test implicit int casting for array accesses */
|
/* test implicit int casting for array accesses */
|
||||||
c = 0;
|
c = 0;
|
||||||
tab[1] = 2;
|
tab[1] = 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user