History

Revert "Fix wrong handling of strings..." (almost)

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)

grischka committed 4 years ago

Commit af1abf11 parent e588b658 files · +98 −129Browse files

Showing the changes to tests (2 of 8 files). Show all

Unified · Split

2 files
  1. tests/tcctest.c +25 −14
  2. tests/tests2/Makefile +1 −2
tests/tcctest.c+25−14
@@ -1519,8 +1519,6 @@ struct structa1 { · 1518 unmodified lines
15191519 char f2;
15201520 };
15211521
1522−struct structa1 ssta1;
1523−
15241522 void struct_assign_test1(struct structa1 s1, int t, float f)
15251523 {
15261524 printf("%d %d %d %f\n", s1.f1, s1.f2, t, f);
@@ -1538,22 +1536,12 @@ void struct_assign_test(void) · 11 unmodified lines
15381536 struct S {
15391537 struct structa1 lsta1, lsta2;
15401538 int i;
1541− } s, *ps;
1539+ } s = {{1,2}, {3,4}}, *ps;
15421540
15431541 ps = &s;
15441542 ps->i = 4;
1545−#if 0
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
1543+
15551544 struct_assign_test1(ps->lsta2, 3, 4.5);
1556−
15571545 printf("before call: %d %d\n", s.lsta2.f1, s.lsta2.f2);
15581546 ps->lsta2 = struct_assign_test2(ps->lsta2, ps->i);
15591547 printf("after call: %d %d\n", ps->lsta2.f1, ps->lsta2.f2);
@@ -1565,6 +1553,9 @@ void struct_assign_test(void) · 5 unmodified lines
15651553 { struct_assign_test }
15661554 };
15671555 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);
15681559 }
15691560
15701561 /* casts to short/char */
@@ -4253,6 +4244,12 @@ void func_arg_test(void) · 2682 unmodified lines
42534244 /* gcc 2.95.3 does not handle correctly CR in strings or after strays */
42544245 #define CORRECT_CR_HANDLING
42554246
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+
42564253 /* keep this as the last test because GCC messes up line-numbers
42574254 with the ^L^K^M characters below */
42584255 void whitespace_test(void)
@@ -4274,6 +4271,20 @@ ntf("aaa=%d\n", 3); · 15 unmodified lines
42744271 \
42754272 ntf("min=%d\n", 4);
42764273
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+
42774288 #ifdef __LINE__
42784289 printf("__LINE__ defined\n");
42794290 #endif
tests/tests2/Makefile+1−2
@@ -105,8 +105,7 @@ GEN-ALWAYS = · 104 unmodified lines
105105 112_backtrace.test: FLAGS += -dt -b
106106 112_backtrace.test 113_btdll.test 126_bound_global.test: FILTER += \
107107 -e 's;[0-9A-Fa-fx]\{5,\};........;g' \
108− -e 's;0x[0-9A-Fa-f]\{1,\};0x?;g' \
109− -e 's;struct copy destination;memmove dest;g' \
108+ -e 's;0x[0-9A-Fa-f]\{1,\};0x?;g'
110109
111110 # this test creates two DLLs and an EXE
112111 113_btdll.test: T1 = \

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