File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -4658,7 +4658,8 @@ and doExp (asconst: bool) (* This expression is used as a constant *)
46584658 prechunk := (fun _ -> empty);
46594659 piscall := false ;
46604660 let compatible =
4661- try ignore(combineTypes CombineOther t1 t2); true
4661+ (* This built-in function ignores top level qualifiers (e.g., const, volatile). *)
4662+ try ignore(combineTypes CombineOther (removeOuterQualifierAttributes t1) (removeOuterQualifierAttributes t2)); true
46624663 with Failure _ -> false
46634664 in
46644665 if compatible then
Original file line number Diff line number Diff line change 1+
2+ // Extracted from the git repository.
3+ // CIL used to crash with "Error: Length of array is negative".
4+
5+ int main () {
6+ const int * a ;
7+ int * ret ;
8+ sizeof (* (ret )) + (sizeof (char [1 - 2 * !(__builtin_types_compatible_p (__typeof__ (* ((ret ))), __typeof__ (* ((a )))))]) - 1 );
9+ return 0 ;
10+ }
Original file line number Diff line number Diff line change @@ -548,6 +548,7 @@ sub addToGroup {
548548addTest(" testrungcc/builtin_object_size _GNUCC=1 OPTIMIZE=1" );
549549addTest(" testrun/builtin4 " );
550550addTest(" test/builtin5 " );
551+ addTest(" test/builtin6 " );
551552addTest(" test/sync-1 _GNUCC=1" );
552553addTest(" test/sync-2 _GNUCC=1" );
553554addTest(" test/sync-3 _GNUCC=1" );
You can’t perform that action at this time.
0 commit comments