History

more tests

bellard committed 24 years ago

Commit 8264c251 parent a42941b1 file · +9 −0Browse files

Unified · Split

tcctest.c+9−0
@@ -204,6 +204,8 @@ void string_test() · 203 unmodified lines
204204 printf("wc=%C 0x%lx %C\n", L'a', L'\x1234', L'c');
205205 printf("wstring=%S\n", L"abc");
206206 printf("wstring=%S\n", L"abc" L"def" "ghi");
207+ printf("'\\377'=%d '\xff'=%d\n", '\377', '\xff');
208+ printf("L'\\377'=%d L'\xff'=%d\n", L'\377', L'\xff');
207209 ps("test\n");
208210 b = 32;
209211 while ((b = b + 1) < 96) {
@@ -425,6 +427,8 @@ void array_test(int a[4]) · 215 unmodified lines
425427 printf("sizeof(unsigned short) = %d\n", sizeof(unsigned short));
426428 printf("sizeof(char) = %d\n", sizeof(char));
427429 printf("sizeof(unsigned char) = %d\n", sizeof(unsigned char));
430+ printf("sizeof(\"a\") = %d\n", sizeof("a"));
431+ printf("sizeof(__func__) = %d\n", sizeof(__func__));
428432 printf("sizeof tab %d\n", sizeof(tab));
429433 printf("sizeof tab2 %d\n", sizeof tab2);
430434 tab[0] = 1;
@@ -868,6 +872,11 @@ void cast_test() · 437 unmodified lines
868872 tab[1] = 2;
869873 tab[c] = 1;
870874 printf("%d %d\n", tab[0], tab[1]);
875+
876+ /* test implicit casting on some operators */
877+ printf("sizeof(+(char)'a') = %d\n", sizeof(+(char)'a'));
878+ printf("sizeof(-(char)'a') = %d\n", sizeof(-(char)'a'));
879+ printf("sizeof(~(char)'a') = %d\n", sizeof(-(char)'a'));
871880 }
872881
873882 /* initializers tests */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t