File tree 5 files changed +16
-10
lines changed
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;
7
7
enum { Econst } e ;
8
8
int a [10 ];
9
9
10
- #ifndef __clang__
11
- STATIC_ASSERT (__builtin_classify_type (* (void * )0 )== 0 );
12
10
STATIC_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
14
15
STATIC_ASSERT (__builtin_classify_type ((_Bool )0 )== 4 );
16
+ #endif
15
17
STATIC_ASSERT (__builtin_classify_type ((int * )0 )== 5 );
16
18
STATIC_ASSERT (__builtin_classify_type (1.0 )== 8 );
17
19
STATIC_ASSERT (__builtin_classify_type (* (0 ?(void * )0 :(double * )0 ))== 8 );
18
20
STATIC_ASSERT (__builtin_classify_type (* (0 ?(double * )0 :(void * )0 ))== 8 );
19
21
STATIC_ASSERT (__builtin_classify_type ((_Complex double )0 )== 9 );
20
22
STATIC_ASSERT (__builtin_classify_type (s )== 12 );
21
23
STATIC_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 );
23
29
#endif
24
30
25
31
#endif
Original file line number Diff line number Diff line change 1
- CORE
1
+ KNOWNBUG
2
2
main.c
3
3
4
4
^EXIT=0$
Original file line number Diff line number Diff line change @@ -2581,7 +2581,7 @@ exprt c_typecheck_baset::do_special_functions(
2581
2581
}
2582
2582
else if (identifier==" __builtin_classify_type" )
2583
2583
{
2584
- // This is a gcc extension that produces an integer
2584
+ // This is a gcc/clang extension that produces an integer
2585
2585
// constant for the type of the argument expression.
2586
2586
if (expr.arguments ().size ()!=1 )
2587
2587
{
@@ -2598,18 +2598,18 @@ exprt c_typecheck_baset::do_special_functions(
2598
2598
2599
2599
unsigned type_number=
2600
2600
type.id ()==ID_empty?0 :
2601
- type.id ()==ID_c_enum_tag?3 :
2601
+ type.id ()==ID_c_enum_tag?1 :
2602
2602
(type.id ()==ID_bool || type.id ()==ID_c_bool)?4 :
2603
2603
type.id ()==ID_pointer?5 :
2604
2604
type.id ()==ID_floatbv?8 :
2605
2605
(type.id ()==ID_complex && type.subtype ().id ()==ID_floatbv)?9 :
2606
2606
type.id ()==ID_struct?12 :
2607
2607
type.id ()==ID_union?13 :
2608
- type.id ()==ID_array?14 :
2608
+ type.id ()==ID_array?5 :
2609
2609
1 ; // int, short
2610
2610
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'.
2613
2613
2614
2614
exprt tmp=from_integer (type_number, expr.type ());
2615
2615
tmp.add_source_location ()=source_location;
You can’t perform that action at this time.
0 commit comments