History

vla: Fix check for vla used by autoconf

1) recursive types have no storage anymore, so a static int (*p)[x]; declaration is just fine 2) since somewhen VT_VLA doesn't imply VT_ARRAY anymore, so we now need to check VLA in at least one place before checking test_lvalue. ((2) should probably be cleaned up again so that VLA does again imply ARRAY)

Michael Matz committed 4 years ago

Commit fa256301 parent 76b88e22 files · +8 −4Browse files

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

Unified · Split

tests/tcctest.c+5−2
@@ -2979,6 +2979,7 @@ void c99_vla_test_2(int d, int h, int w) · 2978 unmodified lines
29792979 int x, y, z;
29802980 int (*arr)[h][w] = malloc(sizeof(int) * d*h*w);
29812981 int c = 1;
2982+ static int (*starr)[h][w];
29822983
29832984 printf("Test C99 VLA 6 (pointer)\n");
29842985
@@ -2998,13 +2999,15 @@ void c99_vla_test_2(int d, int h, int w) · 13 unmodified lines
29982999 }
29993000 puts("");
30003001 }
3002+ starr = &arr[1];
30013003 printf(" sizes : %d %d %d\n"
30023004 " pdiff : %d %d\n"
3003− " tests : %d %d\n",
3005+ " tests : %d %d %d\n",
30043006 sizeof (*arr), sizeof (*arr)[0], sizeof (*arr)[0][0],
30053007 arr + 2 - arr, *arr + 3 - *arr,
30063008 0 == sizeof (*arr + 1) - sizeof arr,
3007− 0 == sizeof sizeof *arr - sizeof arr
3009+ 0 == sizeof sizeof *arr - sizeof arr,
3010+ starr[0][2][3] == arr[1][2][3]
30083011 );
30093012 free (arr);
30103013 }

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