diff options
| author | bellard <bellard> | 2002-07-27 14:06:23 +0000 |
|---|---|---|
| committer | bellard <bellard> | 2002-07-27 14:06:23 +0000 |
| commit | 8264c257e73ed790f5abf53e04d662082af63af2 (patch) | |
| tree | 77fe71fc2bcf9081ba2a0fc5ab38dd0890e2394c /tcctest.c | |
| parent | a42941b1f0606ec31657138b9dbecb92902743af (diff) | |
| download | tinycc-8264c257e73ed790f5abf53e04d662082af63af2.tar.gz tinycc-8264c257e73ed790f5abf53e04d662082af63af2.tar.bz2 | |
more tests
Diffstat (limited to 'tcctest.c')
| -rw-r--r-- | tcctest.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -204,6 +204,8 @@ void string_test() printf("wc=%C 0x%lx %C\n", L'a', L'\x1234', L'c'); printf("wstring=%S\n", L"abc"); printf("wstring=%S\n", L"abc" L"def" "ghi"); + printf("'\\377'=%d '\xff'=%d\n", '\377', '\xff'); + printf("L'\\377'=%d L'\xff'=%d\n", L'\377', L'\xff'); ps("test\n"); b = 32; while ((b = b + 1) < 96) { @@ -425,6 +427,8 @@ void array_test(int a[4]) printf("sizeof(unsigned short) = %d\n", sizeof(unsigned short)); printf("sizeof(char) = %d\n", sizeof(char)); printf("sizeof(unsigned char) = %d\n", sizeof(unsigned char)); + printf("sizeof(\"a\") = %d\n", sizeof("a")); + printf("sizeof(__func__) = %d\n", sizeof(__func__)); printf("sizeof tab %d\n", sizeof(tab)); printf("sizeof tab2 %d\n", sizeof tab2); tab[0] = 1; @@ -868,6 +872,11 @@ void cast_test() tab[1] = 2; tab[c] = 1; printf("%d %d\n", tab[0], tab[1]); + + /* test implicit casting on some operators */ + 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')); } /* initializers tests */ |
