File tree Expand file tree Collapse file tree 5 files changed +16
-10
lines changed Expand file tree Collapse file tree 5 files changed +16
-10
lines changed File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -7,19 +7,25 @@ union { int i; } u;
77enum { Econst } e ;
88int a [10 ];
99
10- #ifndef __clang__
11- STATIC_ASSERT (__builtin_classify_type (* (void * )0 )== 0 );
1210STATIC_ASSERT (__builtin_classify_type ((int )0 )== 1 );
13- STATIC_ASSERT (__builtin_classify_type (e )== 3 );
11+ STATIC_ASSERT (__builtin_classify_type (e )== 1 );
12+ #ifndef __clang__
13+ STATIC_ASSERT (__builtin_classify_type ((_Bool )0 )== 1 );
14+ #else
1415STATIC_ASSERT (__builtin_classify_type ((_Bool )0 )== 4 );
16+ #endif
1517STATIC_ASSERT (__builtin_classify_type ((int * )0 )== 5 );
1618STATIC_ASSERT (__builtin_classify_type (1.0 )== 8 );
1719STATIC_ASSERT (__builtin_classify_type (* (0 ?(void * )0 :(double * )0 ))== 8 );
1820STATIC_ASSERT (__builtin_classify_type (* (0 ?(double * )0 :(void * )0 ))== 8 );
1921STATIC_ASSERT (__builtin_classify_type ((_Complex double )0 )== 9 );
2022STATIC_ASSERT (__builtin_classify_type (s )== 12 );
2123STATIC_ASSERT (__builtin_classify_type (u )== 13 );
22- STATIC_ASSERT (__builtin_classify_type (a )== 14 );
24+ STATIC_ASSERT (__builtin_classify_type (a )== 5 );
25+ #ifndef __clang__
26+ STATIC_ASSERT (__builtin_classify_type ((char )0 )== 15 );
27+ #else
28+ STATIC_ASSERT (__builtin_classify_type ((char )0 )== 1 );
2329#endif
2430
2531#endif
Original file line number Diff line number Diff line change 1- CORE
1+ KNOWNBUG
22main.c
33
44^EXIT=0$
Original file line number Diff line number Diff line change @@ -2581,7 +2581,7 @@ exprt c_typecheck_baset::do_special_functions(
25812581 }
25822582 else if (identifier==" __builtin_classify_type" )
25832583 {
2584- // This is a gcc extension that produces an integer
2584+ // This is a gcc/clang extension that produces an integer
25852585 // constant for the type of the argument expression.
25862586 if (expr.arguments ().size ()!=1 )
25872587 {
@@ -2598,18 +2598,18 @@ exprt c_typecheck_baset::do_special_functions(
25982598
25992599 unsigned type_number=
26002600 type.id ()==ID_empty?0 :
2601- type.id ()==ID_c_enum_tag?3 :
2601+ type.id ()==ID_c_enum_tag?1 :
26022602 (type.id ()==ID_bool || type.id ()==ID_c_bool)?4 :
26032603 type.id ()==ID_pointer?5 :
26042604 type.id ()==ID_floatbv?8 :
26052605 (type.id ()==ID_complex && type.subtype ().id ()==ID_floatbv)?9 :
26062606 type.id ()==ID_struct?12 :
26072607 type.id ()==ID_union?13 :
2608- type.id ()==ID_array?14 :
2608+ type.id ()==ID_array?5 :
26092609 1 ; // int, short
26102610
2611- // clang returns 15 for the three 'char' types,
2612- // gcc treats these as 'int'
2611+ // clang returns 15 for the three 'char' types, gcc treats these as 'int'.
2612+ // clang returns 4 for _Bool, gcc treats these as 'int'.
26132613
26142614 exprt tmp=from_integer (type_number, expr.type ());
26152615 tmp.add_source_location ()=source_location;
You can’t perform that action at this time.
0 commit comments