See commit e588b65390bcfadabfb00c32ae0bfee12a8a8002. Was not "wrong" really, just different. But appears to be outdated. Now disabled by default (top of tccpp.c: ACCEPT_LF_IN_STRINGS) Also, in skipped code, just warn. Also: cleanup "Optimize small structure copying on x86_64" (commit 3715f1d7ee302c220d36f545107bbf808fd979d9) - remove some copy&paste coding (tccgen.c) - RSI/RDI need to be preserved on windows - simply don't use under bcheck (this is tinycc)
Showing the changes to tests (2 of 8 files). Show all
Unified · Split
| @@ -1519,8 +1519,6 @@ struct structa1 { · 1518 unmodified lines | |||
| 1519 | char f2; | 1519 | char f2; |
| 1520 | }; | 1520 | }; |
| 1521 | 1521 | ||
| 1522 | struct structa1 ssta1; | ||
| 1523 | |||
| 1524 | void struct_assign_test1(struct structa1 s1, int t, float f) | 1522 | void struct_assign_test1(struct structa1 s1, int t, float f) |
| 1525 | { | 1523 | { |
| 1526 | printf("%d %d %d %f\n", s1.f1, s1.f2, t, f); | 1524 | printf("%d %d %d %f\n", s1.f1, s1.f2, t, f); |
| @@ -1538,22 +1536,12 @@ void struct_assign_test(void) · 11 unmodified lines | |||
| 1538 | struct S { | 1536 | struct S { |
| 1539 | struct structa1 lsta1, lsta2; | 1537 | struct structa1 lsta1, lsta2; |
| 1540 | int i; | 1538 | int i; |
| 1541 | } s, *ps; | 1539 | } s = {{1,2}, {3,4}}, *ps; |
| 1542 | 1540 | ||
| 1543 | ps = &s; | 1541 | ps = &s; |
| 1544 | ps->i = 4; | 1542 | ps->i = 4; |
| 1545 | #if 0 | 1543 | |
| 1546 | s.lsta1.f1 = 1; | ||
| 1547 | s.lsta1.f2 = 2; | ||
| 1548 | printf("%d %d\n", s.lsta1.f1, s.lsta1.f2); | ||
| 1549 | s.lsta2 = s.lsta1; | ||
| 1550 | printf("%d %d\n", s.lsta2.f1, s.lsta2.f2); | ||
| 1551 | #else | ||
| 1552 | s.lsta2.f1 = 1; | ||
| 1553 | s.lsta2.f2 = 2; | ||
| 1554 | #endif | ||
| 1555 | struct_assign_test1(ps->lsta2, 3, 4.5); | 1544 | struct_assign_test1(ps->lsta2, 3, 4.5); |
| 1556 | |||
| 1557 | printf("before call: %d %d\n", s.lsta2.f1, s.lsta2.f2); | 1545 | printf("before call: %d %d\n", s.lsta2.f1, s.lsta2.f2); |
| 1558 | ps->lsta2 = struct_assign_test2(ps->lsta2, ps->i); | 1546 | ps->lsta2 = struct_assign_test2(ps->lsta2, ps->i); |
| 1559 | printf("after call: %d %d\n", ps->lsta2.f1, ps->lsta2.f2); | 1547 | printf("after call: %d %d\n", ps->lsta2.f1, ps->lsta2.f2); |
| @@ -1565,6 +1553,9 @@ void struct_assign_test(void) · 5 unmodified lines | |||
| 1565 | { struct_assign_test } | 1553 | { struct_assign_test } |
| 1566 | }; | 1554 | }; |
| 1567 | printf("%d\n", struct_assign_test == t[0].elem); | 1555 | printf("%d\n", struct_assign_test == t[0].elem); |
| 1556 | |||
| 1557 | s.lsta1 = s.lsta2 = struct_assign_test2(s.lsta1, 1); | ||
| 1558 | printf("%d %d\n", s.lsta1.f1, s.lsta1.f2); | ||
| 1568 | } | 1559 | } |
| 1569 | 1560 | ||
| 1570 | /* casts to short/char */ | 1561 | /* casts to short/char */ |
| @@ -4253,6 +4244,12 @@ void func_arg_test(void) · 2682 unmodified lines | |||
| 4253 | /* gcc 2.95.3 does not handle correctly CR in strings or after strays */ | 4244 | /* gcc 2.95.3 does not handle correctly CR in strings or after strays */ |
| 4254 | #define CORRECT_CR_HANDLING | 4245 | #define CORRECT_CR_HANDLING |
| 4255 | 4246 | ||
| 4247 | /* deprecated and no longer supported in gcc 3.3 */ | ||
| 4248 | /* no longer supported by default in TinyCC */ | ||
| 4249 | #ifdef __TINYC__ | ||
| 4250 | /* # define ACCEPT_LF_IN_STRINGS */ | ||
| 4251 | #endif | ||
| 4252 | |||
| 4256 | /* keep this as the last test because GCC messes up line-numbers | 4253 | /* keep this as the last test because GCC messes up line-numbers |
| 4257 | with the ^L^K^M characters below */ | 4254 | with the ^L^K^M characters below */ |
| 4258 | void whitespace_test(void) | 4255 | void whitespace_test(void) |
| @@ -4274,6 +4271,20 @@ ntf("aaa=%d\n", 3); · 15 unmodified lines | |||
| 4274 | \ | 4271 | \ |
| 4275 | ntf("min=%d\n", 4); | 4272 | ntf("min=%d\n", 4); |
| 4276 | 4273 | ||
| 4274 | #ifdef ACCEPT_LF_IN_STRINGS | ||
| 4275 | printf("len1=%d\n", strlen(" | ||
| 4276 | ")); | ||
| 4277 | #ifdef CORRECT_CR_HANDLING | ||
| 4278 | str = " | ||
| 4279 | "; | ||
| 4280 | printf("len1=%d str[0]=%d\n", strlen(str), str[0]); | ||
| 4281 | #endif | ||
| 4282 | printf("len1=%d\n", strlen(" a | ||
| 4283 | ")); | ||
| 4284 | #else | ||
| 4285 | printf("len1=1\nlen1=1 str[0]=10\nlen1=3\n"); | ||
| 4286 | #endif /* ACCEPT_LF_IN_STRINGS */ | ||
| 4287 | |||
| 4277 | #ifdef __LINE__ | 4288 | #ifdef __LINE__ |
| 4278 | printf("__LINE__ defined\n"); | 4289 | printf("__LINE__ defined\n"); |
| 4279 | #endif | 4290 | #endif |
| @@ -105,8 +105,7 @@ GEN-ALWAYS = · 104 unmodified lines | |||
| 105 | 112_backtrace.test: FLAGS += -dt -b | 105 | 112_backtrace.test: FLAGS += -dt -b |
| 106 | 112_backtrace.test 113_btdll.test 126_bound_global.test: FILTER += \ | 106 | 112_backtrace.test 113_btdll.test 126_bound_global.test: FILTER += \ |
| 107 | -e 's;[0-9A-Fa-fx]\{5,\};........;g' \ | 107 | -e 's;[0-9A-Fa-fx]\{5,\};........;g' \ |
| 108 | -e 's;0x[0-9A-Fa-f]\{1,\};0x?;g' \ | 108 | -e 's;0x[0-9A-Fa-f]\{1,\};0x?;g' |
| 109 | -e 's;struct copy destination;memmove dest;g' \ | ||
| 110 | 109 | ||
| 111 | # this test creates two DLLs and an EXE | 110 | # this test creates two DLLs and an EXE |
| 112 | 113_btdll.test: T1 = \ | 111 | 113_btdll.test: T1 = \ |