Skip to content

Commit

Permalink
Add test case extracted from the git repository
Browse files Browse the repository at this point in the history
  • Loading branch information
karoliineh committed Oct 2, 2023
1 parent 44f156c commit e9060b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/small1/builtin6.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

// Extracted from the git repository.
// CIL used to crash with "Error: Length of array is negative".

int main() {
const int *a;
int *ret;
sizeof(*(ret)) + (sizeof(char [1 - 2*!(__builtin_types_compatible_p(__typeof__(*((ret))), __typeof__(*((a)))))]) - 1);
return 0;
}
1 change: 1 addition & 0 deletions test/testcil.pl
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ sub addToGroup {
addTest("testrungcc/builtin_object_size _GNUCC=1 OPTIMIZE=1");
addTest("testrun/builtin4 ");
addTest("test/builtin5 ");
addTest("test/builtin6 ");
addTest("test/sync-1 _GNUCC=1");
addTest("test/sync-2 _GNUCC=1");
addTest("test/sync-3 _GNUCC=1");
Expand Down

0 comments on commit e9060b8

Please sign in to comment.