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
204 printf("wc=%C 0x%lx %C\n", L'a', L'\x1234', L'c');204 printf("wc=%C 0x%lx %C\n", L'a', L'\x1234', L'c');
205 printf("wstring=%S\n", L"abc");205 printf("wstring=%S\n", L"abc");
206 printf("wstring=%S\n", L"abc" L"def" "ghi");206 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');
207 ps("test\n");209 ps("test\n");
208 b = 32;210 b = 32;
209 while ((b = b + 1) < 96) {211 while ((b = b + 1) < 96) {
@@ -425,6 +427,8 @@ void array_test(int a[4]) · 215 unmodified lines
425 printf("sizeof(unsigned short) = %d\n", sizeof(unsigned short));427 printf("sizeof(unsigned short) = %d\n", sizeof(unsigned short));
426 printf("sizeof(char) = %d\n", sizeof(char));428 printf("sizeof(char) = %d\n", sizeof(char));
427 printf("sizeof(unsigned char) = %d\n", sizeof(unsigned char));429 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__));
428 printf("sizeof tab %d\n", sizeof(tab));432 printf("sizeof tab %d\n", sizeof(tab));
429 printf("sizeof tab2 %d\n", sizeof tab2);433 printf("sizeof tab2 %d\n", sizeof tab2);
430 tab[0] = 1;434 tab[0] = 1;
@@ -868,6 +872,11 @@ void cast_test() · 437 unmodified lines
868 tab[1] = 2;872 tab[1] = 2;
869 tab[c] = 1;873 tab[c] = 1;
870 printf("%d %d\n", tab[0], tab[1]);874 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'));
871}880}
872 881
873/* initializers tests */882/* 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