File tree Expand file tree Collapse file tree 15 files changed +70
-10
lines changed Expand file tree Collapse file tree 15 files changed +70
-10
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
- gcc -Wno-macro-redefined -U __clang_major__ -D __GNUC__=4 -D __GNUC_MINOR__=9 -D __GNUC_PATCHLEVEL__=1 $*
3
+ gcc -Wno-macro-redefined -U __clang_major__ -D __GNUC__=4 -D __GNUC_MINOR__=2 -D __GNUC_PATCHLEVEL__=1 " $@ "
4
4
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ gcc -Wno-macro-redefined -U __clang_major__ -D __GNUC__=5 -D __GNUC_MINOR__=0 -D __GNUC_PATCHLEVEL__=0 " $@ "
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
- gcc -Wno-macro-redefined -U __clang_major__ -D __GNUC__=7 -D __GNUC_MINOR__=0 -D __GNUC_PATCHLEVEL__=0 $*
3
+ gcc -Wno-macro-redefined -U __clang_major__ -D __GNUC__=7 -D __GNUC_MINOR__=0 -D __GNUC_PATCHLEVEL__=0 " $@ "
4
4
Original file line number Diff line number Diff line change 1
- typedef double _Float64 ;
1
+ // None of these types should be defined when emulating gcc-4:
2
2
3
+ typedef float _Float32 ;
4
+ typedef double _Float32x ;
5
+ typedef double _Float64 ;
6
+ typedef long double _Float64x ;
7
+ typedef long double _Float128 ;
8
+ typedef long double _Float128x ;
Original file line number Diff line number Diff line change
1
+ // These types should *not* be provided when emulating gcc-5:
2
+ typedef float _Float32 ;
3
+ typedef double _Float32x ;
4
+ typedef double _Float64 ;
5
+ typedef long double _Float64x ;
6
+ typedef long double _Float128x ;
7
+
8
+ // But this type should:
9
+ _Float128 f128 ;
Original file line number Diff line number Diff line change 1
- _Float64 some_var ;
2
-
1
+ // All these types should be provided when emulating gcc-7:
2
+ _Float32 f32 ;
3
+ _Float32x f32x ;
4
+ _Float64 f64 ;
5
+ _Float64x f64x ;
6
+ _Float128 f128 ;
7
+ _Float128x f128x ;
Original file line number Diff line number Diff line change
1
+ CORE
2
+ gcc-5.c
3
+ --native-compiler ./fake-gcc-5
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ --
7
+ ^CONVERSION ERROR$
Original file line number Diff line number Diff line change 1
- #if defined(__clang__ )
2
- #elif defined(__GNUC__ )
1
+ #if defined(__GNUC__ ) && !defined(__clang__ )
2
+
3
+ #include <features.h> // For __GNUC_PREREQ
4
+
5
+ #ifdef __x86_64__
6
+ #define FLOAT128_MINOR_VERSION 3
7
+ #else
8
+ #define FLOAT128_MINOR_VERSION 5
9
+ #endif
10
+
3
11
#if __GNUC__ >= 7
4
12
#define HAS_FLOATN
13
+ #elif __GNUC_PREREQ (4 , FLOAT128_MINOR_VERSION )
14
+ #define HAS_FLOAT128
5
15
#endif
16
+
6
17
#endif
7
18
8
19
#ifndef HAS_FLOATN
9
20
typedef float _Float32 ;
10
21
typedef double _Float32x ;
11
22
typedef double _Float64 ;
12
23
typedef long double _Float64x ;
13
- typedef long double _Float128 ;
14
24
typedef long double _Float128x ;
15
25
#endif
16
26
27
+ #if !defined(HAS_FLOATN ) && !defined(HAS_FLOAT128 )
28
+ typedef long double _Float128 ;
29
+ #endif
30
+
17
31
int main (int argc , char * * argv ) {
18
32
}
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ bool ansi_c_languaget::parse(
76
76
ansi_c_parser.set_message_handler (get_message_handler ());
77
77
ansi_c_parser.for_has_scope =config.ansi_c .for_has_scope ;
78
78
ansi_c_parser.ts_18661_3_Floatn_types =config.ansi_c .ts_18661_3_Floatn_types ;
79
+ ansi_c_parser.Float128_type = config.ansi_c .Float128_type ;
79
80
ansi_c_parser.cpp98 =false ; // it's not C++
80
81
ansi_c_parser.cpp11 =false ; // it's not C++
81
82
ansi_c_parser.mode =config.ansi_c .mode ;
Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ class ansi_c_parsert:public parsert
36
36
cpp98 (false ),
37
37
cpp11 (false ),
38
38
for_has_scope (false ),
39
- ts_18661_3_Floatn_types(false )
39
+ ts_18661_3_Floatn_types(false ),
40
+ Float128_type(false )
40
41
{
41
42
}
42
43
@@ -81,6 +82,9 @@ class ansi_c_parsert:public parsert
81
82
// ISO/IEC TS 18661-3:2015
82
83
bool ts_18661_3_Floatn_types;
83
84
85
+ // Does the compiler version emulated provide _Float128?
86
+ bool Float128_type;
87
+
84
88
typedef ansi_c_identifiert identifiert;
85
89
typedef ansi_c_scopet scopet;
86
90
You can’t perform that action at this time.
0 commit comments