Changes in / [de8a0a4b:0f070a4]
- Files:
-
- 13 deleted
- 19 edited
-
libcfa/src/iostream.cfa (modified) (15 diffs)
-
src/AST/Expr.cpp (modified) (1 diff)
-
src/AST/Expr.hpp (modified) (2 diffs)
-
src/AST/Fwd.hpp (modified) (1 diff)
-
src/AST/Pass.hpp (modified) (1 diff)
-
src/AST/Pass.impl.hpp (modified) (2 diffs)
-
src/AST/Print.cpp (modified) (1 diff)
-
src/AST/Visitor.hpp (modified) (1 diff)
-
src/BasicTypes-gen.cpp (modified) (4 diffs)
-
src/CodeGen/CodeGenerator.cpp (modified) (1 diff)
-
src/Common/CodeLocationTools.cpp (modified) (1 diff)
-
src/Concurrency/Keywords.cpp (modified) (13 diffs)
-
src/InitTweak/GenInit.cpp (modified) (1 diff)
-
src/Parser/parser.yy (modified) (1 diff)
-
src/ResolvExpr/CandidateFinder.cpp (modified) (6 diffs)
-
src/ResolvExpr/ConversionCost.cpp (modified) (2 diffs)
-
tests/.expect/arithmeticConversions.arm64.txt (deleted)
-
tests/arithmeticConversions.cfa (modified) (2 diffs)
-
tests/array-collections/boxed.bookend.cfa (modified) (2 diffs)
-
tests/io/.expect/eofType.txt (deleted)
-
tests/io/.in/eofType.bool.1.txt (deleted)
-
tests/io/.in/eofType.bool.2.txt (deleted)
-
tests/io/.in/eofType.char.1.txt (deleted)
-
tests/io/.in/eofType.char.2.txt (deleted)
-
tests/io/.in/eofType.complex.1.txt (deleted)
-
tests/io/.in/eofType.complex.2.txt (deleted)
-
tests/io/.in/eofType.double.1.txt (deleted)
-
tests/io/.in/eofType.double.2.txt (deleted)
-
tests/io/.in/eofType.int.1.txt (deleted)
-
tests/io/.in/eofType.int.2.txt (deleted)
-
tests/io/eofType.cfa (deleted)
-
tests/malloc.cfa (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.cfa
rde8a0a4b r0f070a4 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jan 22 07:31:19 202513 // Update Count : 20 7912 // Last Modified On : Sun Oct 13 10:53:09 2024 13 // Update Count : 2041 14 14 // 15 15 … … 777 777 forall( istype & | basic_istream( istype ) ) { 778 778 istype & ?|?( istype & is, bool & b ) { 779 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 779 780 int len = -1; // len not set if no match 780 fmt( is, " " ); // remove leading whitespace781 fmt( is, FALSE "%n", &len ); // try false, returns 0781 // remove optional leading whitespace at start of strings. 782 fmt( is, " " FALSE "%n", &len ); // try false 782 783 if ( len != sizeof( FALSE ) - 1 ) { // -1 removes null terminate 783 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 784 fmt( is, " " ); // remove leading whitespace 785 fmt( is, TRUE "%n", &len ); // try true, returns 0 784 fmt( is, " " TRUE "%n", &len ); // try true 786 785 if ( len != sizeof( TRUE ) - 1 ) throwResume ExceptionInst( missing_data ); 787 786 b = true; … … 793 792 794 793 istype & ?|?( istype & is, char & c ) { 794 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 795 795 char temp; 796 796 for () { 797 int args = fmt( is, "%c", &temp ); // can be called with EOF on797 int args = fmt( is, "%c", &temp ); 798 798 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 799 799 assert( args == 1 ); // if not EOF => a single character must be read … … 805 805 806 806 istype & ?|?( istype & is, signed char & sc ) { 807 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 807 808 int args = fmt( is, "%hhi", &sc ); // can be multiple characters (100) 808 809 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 809 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );810 810 return is; 811 811 } // ?|? 812 812 813 813 istype & ?|?( istype & is, unsigned char & usc ) { 814 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 814 815 int args = fmt( is, "%hhi", &usc ); // can be multiple characters (-100) 815 816 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 816 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );817 817 return is; 818 818 } // ?|? 819 819 820 820 istype & ?|?( istype & is, short int & si ) { 821 int args = fmt( is, "%hi", &si ); // can be called with EOF on 821 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 822 int args = fmt( is, "%hi", &si ); 822 823 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 823 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );824 824 return is; 825 825 } // ?|? 826 826 827 827 istype & ?|?( istype & is, unsigned short int & usi ) { 828 int args = fmt( is, "%hi", &usi ); // can be called with EOF on 828 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 829 int args = fmt( is, "%hi", &usi ); 829 830 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 830 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );831 831 return is; 832 832 } // ?|? 833 833 834 834 istype & ?|?( istype & is, int & i ) { 835 int args = fmt( is, "%i", &i ); // can be called with EOF on 835 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 836 int args = fmt( is, "%i", &i ); 836 837 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 837 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );838 838 return is; 839 839 } // ?|? 840 840 841 841 istype & ?|?( istype & is, unsigned int & ui ) { 842 int args = fmt( is, "%i", &ui ); // can be called with EOF on 842 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 843 int args = fmt( is, "%i", &ui ); 843 844 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 844 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );845 845 return is; 846 846 } // ?|? 847 847 848 848 istype & ?|?( istype & is, long int & li ) { 849 int args = fmt( is, "%li", &li ); // can be called with EOF on 849 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 850 int args = fmt( is, "%li", &li ); 850 851 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 851 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );852 852 return is; 853 853 } // ?|? 854 854 855 855 istype & ?|?( istype & is, unsigned long int & ulli ) { 856 int args = fmt( is, "%li", &ulli ); // can be called with EOF on 856 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 857 int args = fmt( is, "%li", &ulli ); 857 858 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 858 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );859 859 return is; 860 860 } // ?|? 861 861 862 862 istype & ?|?( istype & is, long long int & lli ) { 863 int args = fmt( is, "%lli", &lli ); // can be called with EOF on 863 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 864 int args = fmt( is, "%lli", &lli ); 864 865 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 865 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );866 866 return is; 867 867 } // ?|? 868 868 869 869 istype & ?|?( istype & is, unsigned long long int & ulli ) { 870 int args = fmt( is, "%lli", &ulli ); // can be called with EOF on 870 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 871 int args = fmt( is, "%lli", &ulli ); 871 872 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 872 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );873 873 return is; 874 874 } // ?|? … … 897 897 898 898 istype & ?|?( istype & is, float & f ) { 899 int args = fmt( is, "%f", &f ); // can be called with EOF on 899 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 900 int args = fmt( is, "%f", &f ); 900 901 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 901 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );902 902 return is; 903 903 } // ?|? 904 904 905 905 istype & ?|?( istype & is, double & d ) { 906 int args = fmt( is, "%lf", &d ); // can be called with EOF on 906 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 907 int args = fmt( is, "%lf", &d ); 907 908 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 908 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );909 909 return is; 910 910 } // ?|? 911 911 912 912 istype & ?|?( istype & is, long double & ld ) { 913 int args = fmt( is, "%Lf", &ld ); // can be called with EOF on 913 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 914 int args = fmt( is, "%Lf", &ld ); 914 915 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 915 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );916 916 return is; 917 917 } // ?|? 918 918 919 919 istype & ?|?( istype & is, float _Complex & fc ) { 920 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 920 921 float re, im; 921 int args = fmt( is, "%f%fi", &re, &im ); // can be called with EOF on922 int args = fmt( is, "%f%fi", &re, &im ); 922 923 if ( ! eof( is ) && args != 2 ) throwResume ExceptionInst( missing_data ); 923 if ( eof( is ) && args != 2 ) throwResume ExceptionInst( end_of_file );924 924 fc = re + im * _Complex_I; 925 925 return is; … … 927 927 928 928 istype & ?|?( istype & is, double _Complex & dc ) { 929 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 929 930 double re, im; 930 int args = fmt( is, "%lf%lfi", &re, &im ); // can be called with EOF on931 int args = fmt( is, "%lf%lfi", &re, &im ); 931 932 if ( ! eof( is ) && args != 2 ) throwResume ExceptionInst( missing_data ); 932 if ( eof( is ) && args != 2 ) throwResume ExceptionInst( end_of_file );933 933 dc = re + im * _Complex_I; 934 934 return is; … … 936 936 937 937 istype & ?|?( istype & is, long double _Complex & ldc ) { 938 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 938 939 long double re, im; 939 int args = fmt( is, "%Lf%Lfi", &re, &im ); // can be called with EOF on940 int args = fmt( is, "%Lf%Lfi", &re, &im ); 940 941 if ( ! eof( is ) && args != 2 ) throwResume ExceptionInst( missing_data ); 941 if ( eof( is ) && args != 2 ) throwResume ExceptionInst( end_of_file );942 942 ldc = re + im * _Complex_I; 943 943 return is; … … 945 945 946 946 istype & ?|?( istype & is, const char fmt[] ) { // match text 947 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 947 948 size_t len = strlen( fmt ); 948 949 char fmtstr[len + 16]; … … 950 951 strcpy( &fmtstr[len], "%n" ); 951 952 len = -1; 952 // scanf cursor does not move if no match, so eof cannot be detected. 953 fmt( is, fmtstr, &len ); // can be called with EOF on 954 if ( ! eof( is ) && len == -1 ) throwResume ExceptionInst( missing_data ); 955 if ( eof( is ) && len == -1 ) throwResume ExceptionInst( end_of_file ); 953 // scanf cursor does not move if no match 954 fmt( is, fmtstr, &len ); 955 if ( len == -1 ) throwResume ExceptionInst( missing_data ); 956 956 return is; 957 957 } // ?|? … … 999 999 char ch; 1000 1000 for ( f.wd ) { // skip N characters 1001 int args = fmt( is, "%c", &ch ); // can be called with EOF on1001 int args = fmt( is, "%c", &ch ); 1002 1002 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 1003 1003 } // for … … 1204 1204 forall( istype & | istream( istype ), E | CfaEnum( E ) | Serial( E ) ) 1205 1205 istype & ?|?( istype & is, E & e ) { 1206 // if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 1206 // fprintf( stderr, "here0\n" ); 1207 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 1207 1208 1208 1209 // Match longest input enumerator string to enumerator labels, where enumerator names are unique. 1209 1210 1210 1211 int N = countof( E ), lnths[N], fred = 0; 1212 // printf( "N %d\n", N ); 1211 1213 int r = 0; 1214 // for ( s; E : r; 0~@ ) { 1212 1215 for ( s; E ) { // scan string rows gathering lengths 1213 1216 lnths[r] = strlen( label( s ) ); 1214 1217 if ( lnths[r] > fred ) fred = lnths[r]; 1218 // fprintf( stderr, "%s %d %d\n", label( s ), lnths[r], fred ); 1215 1219 r += 1; 1216 1220 } // for … … 1219 1223 char ch, curr = '\0', prev = '\0'; 1220 1224 1221 fmt( is, " " ); // remove leadingwhitespace1225 fmt( is, " " ); // skip optional whitespace 1222 1226 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 1223 1227 1224 1228 for ( c; fred ) { // scan columns of the label matix (some columns missing) 1225 1229 int args = fmt( is, "%c", &ch ); // read character 1230 // fprintf( stderr, "fmt args: %d eof: %d\n", args, eof(is) ); 1226 1231 if ( eof( is ) ) { 1232 // fprintf( stderr, "Eof1\n" ); 1227 1233 if ( c == 0 ) return is; // no characters read ? 1228 1234 clear( is ); // => read something => reset EOF => detect again on next read 1235 // fprintf( stderr, "Eof2\n" ); 1229 1236 break; 1230 1237 } // if 1231 1238 if ( args != 1 ) throwResume ExceptionInst( missing_data ); // may be unnecessary since reading single character 1232 1239 1240 // printf( "read '%c'\n", ch ); 1233 1241 for ( r; N ) { // scan enumeration strings for matching character in current column 1242 // printf( "%d %d %d\n", c, r, lnths[r] ); 1234 1243 if ( c < lnths[r] ) { // string long enough for this column check ? 1235 1244 char match = label( fromInt( r ) )[c]; // optimization 1245 // printf( "%c '%c'\n", match, ch ); 1236 1246 // Stop on first match, could be other matches. 1237 1247 if ( (match == ch) && (c == 0 || curr == label( fromInt( r ) )[c - 1]) ) { 1248 // printf( "match %d %d %d '%c' '%c' '%c' '%c' 'c'\n", c, r, lnths[r], match, ch, prev, label( fromInt( r ) )[c - 1] ); 1238 1249 mcol = c; // matching column 1239 1250 prev = curr; // last matching character … … 1243 1254 } // if 1244 1255 } else { 1256 // fprintf( stderr, "finished mcol: %d ch: '%c' curr: '%c' prev: '%c'\n", mcol, ch, curr, prev ); 1245 1257 ungetc( ch, is ); // push back last unmatching character 1246 1258 if ( mcol == -1 ) throwResume ExceptionInst( missing_data ); // no matching character in first column 1247 1259 break; 1248 1260 } // for 1261 // printf( "\n" ); 1262 // } else { 1263 // fprintf( stderr, "finished2 %d\n", mcol ); 1249 1264 } // for 1250 1265 … … 1252 1267 if ( mcol == lnths[c] - 1 ) { 1253 1268 char match = label( fromInt( c ) )[mcol]; // optimization 1269 // printf( "finished1 mcol: %d c: %d lnth: %d match: '%c' curr: '%c' prev: '%c'\n", mcol, c, lnths[c], match, curr, prev ); 1254 1270 if ( (match == curr) && (mcol == 0 || prev == label( fromInt( c ) )[mcol - 1]) ) { 1255 1271 e = fromInt( c ); … … 1258 1274 } // if 1259 1275 } else { 1276 // fprintf( stderr, "finished3 %d\n", mcol ); 1260 1277 throwResume ExceptionInst( missing_data ); // no match in this column 1261 1278 } // for -
src/AST/Expr.cpp
rde8a0a4b r0f070a4 283 283 : Expr( loc, new BasicType{ BasicKind::LongUnsignedInt } ), type( t ) {} 284 284 285 // --- CountExpr 286 287 CountExpr::CountExpr( const CodeLocation & loc, const Expr * e ) 288 : Expr( loc, new BasicType( BasicKind::LongUnsignedInt) ), expr(e), type( nullptr ) {} 289 290 CountExpr::CountExpr( const CodeLocation & loc, const Type * t ) 291 : Expr( loc, new BasicType( BasicKind::LongUnsignedInt) ), expr(nullptr), type( t ) {} 292 285 293 // --- AlignofExpr 286 294 287 295 AlignofExpr::AlignofExpr( const CodeLocation & loc, const Type * t ) 288 296 : Expr( loc, new BasicType{ BasicKind::LongUnsignedInt } ), type( t ) {} 289 290 // --- CountofExpr291 292 CountofExpr::CountofExpr( const CodeLocation & loc, const Type * t )293 : Expr( loc, new BasicType( BasicKind::LongUnsignedInt) ), type( t ) {}294 297 295 298 // --- OffsetofExpr -
src/AST/Expr.hpp
rde8a0a4b r0f070a4 490 490 }; 491 491 492 class CountExpr final : public Expr { 493 public: 494 ptr<Expr> expr; 495 ptr<Type> type; 496 497 CountExpr( const CodeLocation & loc, const Expr * t ); 498 CountExpr( const CodeLocation & loc, const Type * t ); 499 500 const Expr * accept( Visitor & v )const override { return v.visit( this ); } 501 private: 502 CountExpr * clone() const override { return new CountExpr( *this ); } 503 MUTATE_FRIEND 504 }; 505 492 506 /// alignof expression, e.g. `alignof(int)`, `alignof 3+4` 493 507 class AlignofExpr final : public Expr { … … 500 514 private: 501 515 AlignofExpr * clone() const override { return new AlignofExpr{ *this }; } 502 MUTATE_FRIEND503 };504 505 /// countof expression, e.g. `countof(AnEnum)`, `countof pred(Head)`506 class CountofExpr final : public Expr {507 public:508 ptr<Type> type;509 510 CountofExpr( const CodeLocation & loc, const Type * t );511 512 const Expr * accept( Visitor & v ) const override { return v.visit( this ); }513 private:514 CountofExpr * clone() const override { return new CountofExpr( *this ); }515 516 MUTATE_FRIEND 516 517 }; -
src/AST/Fwd.hpp
rde8a0a4b r0f070a4 86 86 class ConstantExpr; 87 87 class SizeofExpr; 88 class CountExpr; 88 89 class AlignofExpr; 89 class CountofExpr;90 90 class UntypedOffsetofExpr; 91 91 class OffsetofExpr; -
src/AST/Pass.hpp
rde8a0a4b r0f070a4 173 173 const ast::Expr * visit( const ast::ConstantExpr * ) override final; 174 174 const ast::Expr * visit( const ast::SizeofExpr * ) override final; 175 const ast::Expr * visit( const ast::CountExpr * ) override final; 175 176 const ast::Expr * visit( const ast::AlignofExpr * ) override final; 176 const ast::Expr * visit( const ast::CountofExpr * ) override final;177 177 const ast::Expr * visit( const ast::UntypedOffsetofExpr * ) override final; 178 178 const ast::Expr * visit( const ast::OffsetofExpr * ) override final; -
src/AST/Pass.impl.hpp
rde8a0a4b r0f070a4 1350 1350 1351 1351 //-------------------------------------------------------------------------- 1352 // CountExpr 1353 template< typename core_t > 1354 const ast::Expr * ast::Pass< core_t >::visit( const ast::CountExpr * node ) { 1355 VISIT_START( node ); 1356 if ( __visit_children() ) { 1357 { 1358 guard_symtab guard { *this }; 1359 maybe_accept( node, &CountExpr::result ); 1360 } 1361 if ( node->type ) { 1362 maybe_accept( node, &CountExpr::type ); 1363 } else { 1364 maybe_accept( node, &CountExpr::expr ); 1365 } 1366 } 1367 VISIT_END( Expr, node ); 1368 } 1369 1370 //-------------------------------------------------------------------------- 1352 1371 // AlignofExpr 1353 1372 template< typename core_t > … … 1361 1380 } 1362 1381 maybe_accept( node, &AlignofExpr::type ); 1363 }1364 1365 VISIT_END( Expr, node );1366 }1367 1368 //--------------------------------------------------------------------------1369 // CountofExpr1370 template< typename core_t >1371 const ast::Expr * ast::Pass< core_t >::visit( const ast::CountofExpr * node ) {1372 VISIT_START( node );1373 1374 if ( __visit_children() ) {1375 {1376 guard_symtab guard { *this };1377 maybe_accept( node, &CountofExpr::result );1378 }1379 maybe_accept( node, &CountofExpr::type );1380 1382 } 1381 1383 -
src/AST/Print.cpp
rde8a0a4b r0f070a4 1207 1207 } 1208 1208 1209 virtual const ast::Expr * visit( const ast::Count ofExpr * node ) override final {1209 virtual const ast::Expr * visit( const ast::CountExpr * node ) override final { 1210 1210 os << "Count Expression on: "; 1211 1211 ++indent; 1212 safe_print( node->type ); 1212 if ( node->type ) node->type->accept( *this ); 1213 else safe_print( node->expr ); 1213 1214 --indent; 1214 1215 postprint( node ); -
src/AST/Visitor.hpp
rde8a0a4b r0f070a4 76 76 virtual const ast::Expr * visit( const ast::ConstantExpr * ) = 0; 77 77 virtual const ast::Expr * visit( const ast::SizeofExpr * ) = 0; 78 virtual const ast::Expr * visit( const ast::CountExpr * ) = 0; 78 79 virtual const ast::Expr * visit( const ast::AlignofExpr * ) = 0; 79 virtual const ast::Expr * visit( const ast::CountofExpr * ) = 0;80 80 virtual const ast::Expr * visit( const ast::UntypedOffsetofExpr * ) = 0; 81 81 virtual const ast::Expr * visit( const ast::OffsetofExpr * ) = 0; -
src/BasicTypes-gen.cpp
rde8a0a4b r0f070a4 99 99 100 100 { Float16, "Float16", "_FH", "_Float16", "DF16_", Floating, Float32, Float16Complex, -1, 7 }, 101 { Float16Complex, "Float16Complex", "_FHC", "_Float16 _Complex", "CDF16_", Floating, Float32Complex, -1, -1, 8},102 103 { Float32, "Float32", "_F", "_Float32", "DF32_", Floating, Float, Float32Complex, -1, 9},104 { Float32Complex, "Float32Complex", "_FC", "_Float32 _Complex", "CDF32_", Floating, FloatComplex, -1, -1, 10},105 { Float, "Float", "F", "float", "f", Floating, Float32x, FloatComplex, -1, 11},106 { FloatComplex, "FloatComplex", "FC", "float _Complex", "Cf", Floating, Float32xComplex, -1, -1, 12},107 { Float32x, "Float32x", "_FX", "_Float32x", "DF32x_", Floating, Float64, Float32xComplex, -1, 1 3},108 { Float32xComplex, "Float32xComplex", "_FXC", "_Float32x _Complex", "CDF32x_", Floating, Float64Complex, -1, -1, 1 4},109 110 { Float64, "Float64", "_FD", "_Float64", "DF64_", Floating, Double, Float64Complex, -1, 1 5},111 { Float64Complex, "Float64Complex", "_FDC", "_Float64 _Complex", "CDF64_", Floating, DoubleComplex, -1, -1, 1 6},112 { Double, "Double", "D", "double", "d", Floating, Float64x, DoubleComplex, -1, 1 7},113 { DoubleComplex, "DoubleComplex", "DC", "double _Complex", "Cd", Floating, Float64xComplex, -1, -1, 1 8},114 { Float64x, "Float64x", "_FDX", "_Float64x", "DF64x_", Floating, Float80, Float64xComplex, -1, 1 9},115 { Float64xComplex, "Float64xComplex", "_FDXC", "_Float64x _Complex", "CDF64x_", Floating, LongDoubleComplex, -1, -1, 20},116 117 { Float80, "Float80", "_F80", "__float80", "Dq", Floating, LongDouble, LongDoubleComplex, -1, 21},101 { Float16Complex, "Float16Complex", "_FHC", "_Float16 _Complex", "CDF16_", Floating, Float32Complex, -1, -1, 7 }, 102 103 { Float32, "Float32", "_F", "_Float32", "DF32_", Floating, Float, Float32Complex, -1, 8 }, 104 { Float32Complex, "Float32Complex", "_FC", "_Float32 _Complex", "CDF32_", Floating, FloatComplex, -1, -1, 8 }, 105 { Float, "Float", "F", "float", "f", Floating, Float32x, FloatComplex, -1, 9 }, 106 { FloatComplex, "FloatComplex", "FC", "float _Complex", "Cf", Floating, Float32xComplex, -1, -1, 9 }, 107 { Float32x, "Float32x", "_FX", "_Float32x", "DF32x_", Floating, Float64, Float32xComplex, -1, 10 }, 108 { Float32xComplex, "Float32xComplex", "_FXC", "_Float32x _Complex", "CDF32x_", Floating, Float64Complex, -1, -1, 10 }, 109 110 { Float64, "Float64", "_FD", "_Float64", "DF64_", Floating, Double, Float64Complex, -1, 11 }, 111 { Float64Complex, "Float64Complex", "_FDC", "_Float64 _Complex", "CDF64_", Floating, DoubleComplex, -1, -1, 11 }, 112 { Double, "Double", "D", "double", "d", Floating, Float64x, DoubleComplex, -1, 12 }, 113 { DoubleComplex, "DoubleComplex", "DC", "double _Complex", "Cd", Floating, Float64xComplex, -1, -1, 12 }, 114 { Float64x, "Float64x", "_FDX", "_Float64x", "DF64x_", Floating, Float80, Float64xComplex, -1, 13 }, 115 { Float64xComplex, "Float64xComplex", "_FDXC", "_Float64x _Complex", "CDF64x_", Floating, LongDoubleComplex, -1, -1, 13 }, 116 117 { Float80, "Float80", "_F80", "__float80", "Dq", Floating, LongDouble, LongDoubleComplex, -1, 14 }, 118 118 // __float80 _Complex, no complex counterpart 119 119 // gcc implements long double as float80 (12 bytes) 120 { LongDouble, "LongDouble", "LD", "long double", "e", Floating, uuFloat128, LongDoubleComplex, -1, 22},121 { LongDoubleComplex, "LongDoubleComplex", "LDC", "long double _Complex", "Ce", Floating, Float128Complex, -1, -1, 23},122 123 { uuFloat128, "uuFloat128", "__FLD", "__float128", "g", Floating, Float128, Float128Complex, -1, 24},120 { LongDouble, "LongDouble", "LD", "long double", "e", Floating, uuFloat128, LongDoubleComplex, -1, 15 }, 121 { LongDoubleComplex, "LongDoubleComplex", "LDC", "long double _Complex", "Ce", Floating, Float128Complex, -1, -1, 15 }, 122 123 { uuFloat128, "uuFloat128", "__FLD", "__float128", "g", Floating, Float128, Float128Complex, -1, 16 }, 124 124 // __float128 _Complex, no complex counterpart 125 { Float128, "Float128", "_FLD", "_Float128", "DF128_", Floating, Float128x, Float128Complex, -1, 25},126 { Float128Complex, "Float128Complex", "_FLDC", "_Float128 _Complex", "CDF128_", Floating, Float128xComplex, -1, -1, 26},125 { Float128, "Float128", "_FLD", "_Float128", "DF128_", Floating, Float128x, Float128Complex, -1, 17 }, 126 { Float128Complex, "Float128Complex", "_FLDC", "_Float128 _Complex", "CDF128_", Floating, Float128xComplex, -1, -1, 17 }, 127 127 128 128 // may not be supported 129 { Float128x, "Float128x", "_FLDX", "_Float128x", "DF128x_", Floating, Float128xComplex, -1, -1, 27},130 { Float128xComplex, "Float128xComplex", "_FLDXC", "_Float128x _Complex", "CDF128x_", Floating, -1, -1, -1, 28 }129 { Float128x, "Float128x", "_FLDX", "_Float128x", "DF128x_", Floating, Float128xComplex, -1, -1, 18 }, 130 { Float128xComplex, "Float128xComplex", "_FLDXC", "_Float128x _Complex", "CDF128x_", Floating, -1, -1, -1, 18 } 131 131 }; // graph 132 132 … … 135 135 static Kind commonTypeMatrix[NUMBER_OF_BASIC_TYPES][NUMBER_OF_BASIC_TYPES]; 136 136 137 // Compute the minimal conversion costs using Dijkstra's algorithm137 // Fangren explain shortest cost algorithm. 138 138 void generateCosts( int row ) { 139 139 bool seen[NUMBER_OF_BASIC_TYPES] = { false /*, ... */ }; … … 176 176 177 177 // traverse children 178 // any conversion should have a cost of at least 1, even if between types of equal rank178 // Fangren explain "max" 179 179 int i = graph[col].left; 180 180 if ( i == -1 ) continue; // leaf … … 191 191 } // generateCosts 192 192 193 // Note: this algorithm is not general. 194 // It relies on the specific structure of the conversion graph. 195 // When the common type is not one of the two given types, we should always have a real and a complex floating point type, 196 // in which case the common type is the next complex type ranked higher than the real type. 193 // Fangren explain this routine if you can. 197 194 void generateCommonType( int row, int col ) { // row <= col 198 195 if ( costMatrix[row][col] >= 0 ) { -
src/CodeGen/CodeGenerator.cpp
rde8a0a4b r0f070a4 251 251 252 252 if ( decl->init ) { 253 bool isGenericInit = options.genC || decl->init->maybeConstructed; 254 output << ( (isGenericInit) ? " = " : " @= " ); 253 output << " = "; 255 254 decl->init->accept( *visitor ); 256 255 } -
src/Common/CodeLocationTools.cpp
rde8a0a4b r0f070a4 154 154 macro(ConstantExpr, Expr) \ 155 155 macro(SizeofExpr, Expr) \ 156 macro(CountExpr, Expr ) \ 156 157 macro(AlignofExpr, Expr) \ 157 macro(CountofExpr, Expr ) \158 158 macro(UntypedOffsetofExpr, Expr) \ 159 159 macro(OffsetofExpr, Expr) \ -
src/Concurrency/Keywords.cpp
rde8a0a4b r0f070a4 10 10 // Created On : Tue Nov 16 9:53:00 2021 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Jan 26 15:16:16 202513 // Update Count : 1512 // Last Modified On : Thu Dec 14 18:02:25 2023 13 // Update Count : 6 14 14 // 15 15 … … 69 69 } 70 70 71 // Describe that it adds the generic parameters and the uses of the generic parameters on the72 // function and first "this" argument.71 // Describe that it adds the generic parameters and the uses of the generic 72 // parameters on the function and first "this" argument. 73 73 ast::FunctionDecl * fixupGenerics( 74 74 const ast::FunctionDecl * func, const ast::StructDecl * decl ) { … … 117 117 118 118 // -------------------------------------------------------------------------- 119 120 // This type describes the general information used to transform a generator, coroutine, monitor, or121 // thread aggregate kind. A pass is made over the AST in ConcurrentSueKeyword::postvisit looking122 // for each of these kinds. When found, this data structure is filled in with the information from123 // the specific structures below, and handleStruct is called to perform the common changes that124 // augment the aggregate kind with fields and generate appropriate companion routines. The location125 // of any extra fields is specified in addField.126 127 119 struct ConcurrentSueKeyword : public ast::WithDeclsToAdd { 128 120 ConcurrentSueKeyword( … … 179 171 }; 180 172 181 // Handles generatortype declarations:173 // Handles thread type declarations: 182 174 // 183 // generator MyGenerator { struct MyGenerator{184 // => int __generator_state;185 // int data; intdata;186 // a_struct_t more_data; a_struct_t more_data;175 // thread Mythread { struct MyThread { 176 // int data; int data; 177 // a_struct_t more_data; a_struct_t more_data; 178 // => thread$ __thrd_d; 187 179 // }; }; 180 // static inline thread$ * get_thread( MyThread * this ) { return &this->__thrd_d; } 188 181 // 189 struct GeneratorKeyword final : public ConcurrentSueKeyword {190 GeneratorKeyword() : ConcurrentSueKeyword(191 " generator$",192 "__ generator_state",193 "get_ generator",194 " Unable to find builtin type generator$\n",195 " ",182 struct ThreadKeyword final : public ConcurrentSueKeyword { 183 ThreadKeyword() : ConcurrentSueKeyword( 184 "thread$", 185 "__thrd", 186 "get_thread", 187 "thread keyword requires threads to be in scope, add #include <thread.hfa>\n", 188 "ThreadCancelled", 196 189 true, 197 ast::AggregateDecl:: Generator)190 ast::AggregateDecl::Thread ) 198 191 {} 199 192 200 virtual ~ GeneratorKeyword() {}193 virtual ~ThreadKeyword() {} 201 194 }; 202 195 … … 204 197 // 205 198 // coroutine MyCoroutine { struct MyCoroutine { 199 // int data; int data; 200 // a_struct_t more_data; a_struct_t more_data; 206 201 // => coroutine$ __cor_d; 207 // int data; int data;208 // a_struct_t more_data; a_struct_t more_data;209 202 // }; }; 210 203 // static inline coroutine$ * get_coroutine( MyCoroutine * this ) { return &this->__cor_d; } … … 227 220 // 228 221 // monitor MyMonitor { struct MyMonitor { 222 // int data; int data; 223 // a_struct_t more_data; a_struct_t more_data; 229 224 // => monitor$ __mon_d; 230 // int data; int data;231 // a_struct_t more_data; a_struct_t more_data;232 225 // }; }; 233 226 // static inline monitor$ * get_coroutine( MyMonitor * this ) { … … 255 248 }; 256 249 257 // Handles threadtype declarations:250 // Handles generator type declarations: 258 251 // 259 // thread Mythread { struct MyThread{260 // => thread$ __thrd_d;261 // int data; intdata;262 // a_struct_t more_data; a_struct_t more_data;252 // generator MyGenerator { struct MyGenerator { 253 // int data; int data; 254 // a_struct_t more_data; a_struct_t more_data; 255 // => int __generator_state; 263 256 // }; }; 264 // static inline thread$ * get_thread( MyThread * this ) { return &this->__thrd_d; }265 257 // 266 struct ThreadKeyword final : public ConcurrentSueKeyword {267 ThreadKeyword() : ConcurrentSueKeyword(268 " thread$",269 "__ thrd",270 "get_ thread",271 " thread keyword requires threads to be in scope, add #include <thread.hfa>\n",272 " ThreadCancelled",258 struct GeneratorKeyword final : public ConcurrentSueKeyword { 259 GeneratorKeyword() : ConcurrentSueKeyword( 260 "generator$", 261 "__generator_state", 262 "get_generator", 263 "Unable to find builtin type generator$\n", 264 "", 273 265 true, 274 ast::AggregateDecl:: Thread)266 ast::AggregateDecl::Generator ) 275 267 {} 276 268 277 virtual ~ ThreadKeyword() {}269 virtual ~GeneratorKeyword() {} 278 270 }; 279 271 … … 362 354 363 355 if ( !exception_name.empty() ) { 364 if ( !typeid_decl || !vtable_decl ) {356 if( !typeid_decl || !vtable_decl ) { 365 357 SemanticError( decl, context_error ); 366 358 } … … 427 419 declsToAddBefore.push_back( 428 420 Virtual::makeTypeIdInstance( location, typeid_type ) ); 429 // If the typeid_type is going to be kept, the other reference will have been made by now, but430 // we also get to avoid extra mutates.421 // If the typeid_type is going to be kept, the other reference will have 422 // been made by now, but we also get to avoid extra mutates. 431 423 ast::ptr<ast::StructInstType> typeid_cleanup = typeid_type; 432 424 } … … 533 525 534 526 auto mutDecl = ast::mutate( decl ); 535 // Insert at start of special aggregate structures => front of vector536 //mutDecl->members.insert( mutDecl->members.begin(), field );537 527 mutDecl->members.push_back( field ); 538 528 … … 927 917 928 918 // If it is a monitor, then it is a monitor. 929 if ( baseStruct->base->is_monitor() || baseStruct->base->is_thread() ) {919 if( baseStruct->base->is_monitor() || baseStruct->base->is_thread() ) { 930 920 SemanticError( decl, "destructors for structures declared as \"monitor\" must use mutex parameters " ); 931 921 } … … 1041 1031 1042 1032 // Make sure that only the outer reference is mutex. 1043 if ( baseStruct->is_mutex() ) {1033 if( baseStruct->is_mutex() ) { 1044 1034 SemanticError( decl, "mutex keyword may only appear once per argument " ); 1045 1035 } … … 1189 1179 } 1190 1180 1191 // Generates a cast to the void ptr to the appropriate lock type and dereferences it before calling1192 // lock or unlock on it used to undo the type erasure done by storing all the lock pointers as void.1181 // generates a cast to the void ptr to the appropriate lock type and dereferences it before calling lock or unlock on it 1182 // used to undo the type erasure done by storing all the lock pointers as void 1193 1183 ast::ExprStmt * MutexKeyword::genVirtLockUnlockExpr( const std::string & fnName, ast::ptr<ast::Expr> expr, const CodeLocation & location, ast::Expr * param ) { 1194 1184 return new ast::ExprStmt( location, -
src/InitTweak/GenInit.cpp
rde8a0a4b r0f070a4 162 162 // FROM USER: float a[ rand() ]; 163 163 // TO GCC: const size_t __len_of_a = rand(); float a[ __len_of_a ]; 164 ast::ObjectDecl * arrayDimension = nullptr; 165 166 const ast::TypeExpr * ty = dynamic_cast< const ast::TypeExpr * >( arrayType->dimension.get() ); 167 if ( ty ) { 168 auto inst = ty->type.as<ast::EnumInstType>(); 169 if ( inst ) { 170 if ( inst->base->isCfa ) { 171 arrayDimension = new ast::ObjectDecl( 172 arrayType->dimension->location, 173 dimensionName.newName(), 174 new ast::BasicType( ast::BasicKind::UnsignedChar ), 175 new ast::SingleInit( 176 arrayType->dimension->location, 177 ast::ConstantExpr::from_int( arrayType->dimension->location, inst->base->members.size() ) 178 ) 179 ); 180 // return arrayType; 181 } 182 } 183 } 184 if ( arrayDimension == nullptr ) { 185 arrayDimension = new ast::ObjectDecl( 164 165 ast::ObjectDecl * arrayDimension = new ast::ObjectDecl( 166 arrayType->dimension->location, 167 dimensionName.newName(), 168 dimType, 169 new ast::SingleInit( 186 170 arrayType->dimension->location, 187 dimensionName.newName(), 188 dimType, 189 new ast::SingleInit( 190 arrayType->dimension->location, 191 arrayType->dimension 192 ) 193 ); 194 } 171 arrayType->dimension 172 ) 173 ); 195 174 196 175 ast::ArrayType * mutType = ast::mutate( arrayType ); -
src/Parser/parser.yy
rde8a0a4b r0f070a4 946 946 } 947 947 | COUNTOF unary_expression 948 { $$ = new ExpressionNode( new ast::Count ofExpr( yylloc, new ast::TypeofType( maybeMoveBuild( $2 )) ) ); }948 { $$ = new ExpressionNode( new ast::CountExpr( yylloc, maybeMoveBuild( $2 ) ) ); } 949 949 | COUNTOF '(' type_no_function ')' 950 { $$ = new ExpressionNode( new ast::Count ofExpr( yylloc, maybeMoveBuildType( $3 ) ) ); }950 { $$ = new ExpressionNode( new ast::CountExpr( yylloc, maybeMoveBuildType( $3 ) ) ); } 951 951 ; 952 952 -
src/ResolvExpr/CandidateFinder.cpp
rde8a0a4b r0f070a4 672 672 void postvisit( const ast::SizeofExpr * sizeofExpr ); 673 673 void postvisit( const ast::AlignofExpr * alignofExpr ); 674 void postvisit( const ast::CountofExpr * countExpr );675 674 void postvisit( const ast::AddressExpr * addressExpr ); 676 675 void postvisit( const ast::LabelAddressExpr * labelExpr ); … … 698 697 void postvisit( const ast::UntypedInitExpr * initExpr ); 699 698 void postvisit( const ast::QualifiedNameExpr * qualifiedExpr ); 699 void postvisit( const ast::CountExpr * countExpr ); 700 700 701 701 void postvisit( const ast::InitExpr * ) { … … 941 941 } 942 942 } 943 943 944 944 945 /// Adds aggregate member interpretations … … 1268 1269 ? conversionCost( fromType, toType, cand->expr->get_lvalue(), symtab, cand->env ) 1269 1270 : castCost( fromType, toType, cand->expr->get_lvalue(), symtab, cand->env ); 1270 1271 1271 1272 // Redefine enum cast 1272 1273 auto argAsEnum = fromType.as<ast::EnumInstType>(); … … 1492 1493 } 1493 1494 1494 void Finder::postvisit( const ast::CountofExpr * countExpr ) { 1495 if ( auto enumInst = countExpr->type.as<ast::EnumInstType>() ) { 1496 addCandidate( ast::ConstantExpr::from_ulong( countExpr->location, enumInst->base->members.size()), tenv ); 1497 return; 1498 } 1499 auto untypedFirst = ast::UntypedExpr::createCall( countExpr->location, "lowerBound", {} ); 1500 auto castFirst = new ast::CastExpr( countExpr->location, untypedFirst , countExpr->type ); 1501 const ast::UntypedExpr * untyped = ast::UntypedExpr::createCall( 1502 countExpr->location, "Countof", { castFirst } 1495 void Finder::postvisit( const ast::CountExpr * countExpr ) { 1496 const ast::UntypedExpr * untyped = nullptr; 1497 if ( countExpr->type ) { 1498 auto enumInst = countExpr->type.as<ast::EnumInstType>(); 1499 if ( enumInst ) { 1500 addCandidate( ast::ConstantExpr::from_ulong(countExpr->location, enumInst->base->members.size()), tenv ); 1501 return; 1502 } 1503 auto untypedFirst = ast::UntypedExpr::createCall( countExpr->location, "lowerBound", {} ); 1504 auto castFirst = new ast::CastExpr( countExpr->location, untypedFirst , countExpr->type ); 1505 untyped = ast::UntypedExpr::createCall( 1506 countExpr->location, "Countof", { castFirst } 1507 ); 1508 } 1509 if (!untyped) untyped = ast::UntypedExpr::createCall( 1510 countExpr->location, "Countof", { countExpr->expr } 1503 1511 ); 1504 1512 CandidateFinder finder( context, tenv ); … … 1506 1514 CandidateList winners = findMinCost( finder.candidates ); 1507 1515 if ( winners.size() == 0 ) { 1508 SemanticError( countExpr , "Countof is not implemented: " );1509 } 1510 if ( winners.size() != 1 ) {1511 SemanticError( countExpr , "Ambiguous expression in countof: " );1516 SemanticError( countExpr->expr, "Countof is not implemented for operand: " ); 1517 } 1518 if ( winners.size() != 1 ) { 1519 SemanticError( countExpr->expr, "Ambiguous expression in countof operand: " ); 1512 1520 } 1513 1521 CandidateRef & choice = winners.front(); -
src/ResolvExpr/ConversionCost.cpp
rde8a0a4b r0f070a4 44 44 signed long long int unsigned long long int 45 45 __int128 unsigned __int128 46 _Float16 47 _Float16 _Complex 48 _Float32 49 _Float32 _Complex 50 float 51 float _Complex 52 _Float32x 53 _Float32x _Complex 54 _Float64 55 _Float64 _Complex 56 double 57 double _Complex 58 _Float64x 59 _Float64x _Complex 46 _Float16 _Float16 _Complex 47 _Float32 _Float32 _Complex 48 float float _Complex 49 _Float32x _Float32x _Complex 50 _Float64 _Float64 _Complex 51 double double _Complex 52 _Float64x _Float64x _Complex 60 53 __float80 61 long double 62 long double _Complex 54 long double long double _Complex 63 55 __float128 64 _Float128 65 _Float128 _Complex 66 _Float128x 67 _Float128x _Complex 56 _Float128 _Float128 _Complex 57 _Float128x _Float128x _Complex 68 58 */ 69 59 // GENERATED END … … 73 63 static const int costMatrix[ast::BasicKind::NUMBER_OF_BASIC_TYPES][ast::BasicKind::NUMBER_OF_BASIC_TYPES] = { // path length from root to node 74 64 /* B C SC UC SI USI I UI LI ULI LLI ULLI __ID__UID _FH _FHC _F _FC F FC _FX _FXC _FD _FDC D DC _FDX_FDXC _F80 LD LDC__FLD _FLD_FLDC_FLDX_FLDXC */ 75 /* B */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, },76 /* C */ { -1, 0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, },77 /* SC */ { -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, },78 /* UC */ { -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, },79 /* SI */ { -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, },80 /* USI */ { -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, },81 /* I */ { -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, },82 /* UI */ { -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, },83 /* LI */ { -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, },84 /* ULI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, },85 /* LLI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, },86 /* ULLI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, },87 /* __ID */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, },88 /* __UID */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, },89 /* _FH */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, },90 /* _FHC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 2, -1, 4, -1, 6, -1, 8, -1, 10, -1, 12, -1, -1, 15, -1, -1, 18, -1, 20, },91 /* _F */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, },92 /* _FC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 2, -1, 4, -1, 6, -1, 8, -1, 10, -1, -1, 13, -1, -1, 16, -1, 18, },93 /* F */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, },94 /* FC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 2, -1, 4, -1, 6, -1, 8, -1, -1, 11, -1, -1, 14, -1, 16, },95 /* _FX */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, },96 /* _FXC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 2, -1, 4, -1, 6, -1, -1, 9, -1, -1, 12, -1, 14, },97 /* _FD */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, },98 /* _FDC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 2, -1, 4, -1, -1, 7, -1, -1, 10, -1, 12, },99 /* D */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, },100 /* DC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 2, -1, -1, 5, -1, -1, 8, -1, 10, },101 /* _FDX */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, },102 /* _FDXC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 3, -1, -1, 6, -1, 8, },103 /* _F80 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, },104 /* LD */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, },105 /* LDC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 3, -1, 5, },106 /* __FLD */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, },107 /* _FLD */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, },108 /* _FLDC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 2, },65 /* B */ { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 17, 17, 18, 18, }, 66 /* C */ { -1, 0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 16, 16, 17, 17, }, 67 /* SC */ { -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 16, 16, 17, 17, }, 68 /* UC */ { -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 16, 16, 17, 17, }, 69 /* SI */ { -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 15, 16, 16, }, 70 /* USI */ { -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 15, 16, 16, }, 71 /* I */ { -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 14, 15, 15, }, 72 /* UI */ { -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 14, 15, 15, }, 73 /* LI */ { -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 13, 14, 14, }, 74 /* ULI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 13, 14, 14, }, 75 /* LLI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 12, 13, 13, }, 76 /* ULLI */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 12, 13, 13, }, 77 /* __ID */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 11, 12, 12, }, 78 /* __UID */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 11, 12, 12, }, 79 /* _FH */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 10, 10, 11, 11, }, 80 /* _FHC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, 4, -1, 5, -1, 6, -1, -1, 8, -1, -1, 10, -1, 11, }, 81 /* _F */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 9, 9, 10, 10, }, 82 /* _FC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, 4, -1, 5, -1, -1, 7, -1, -1, 9, -1, 10, }, 83 /* F */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 8, 8, 9, 9, }, 84 /* FC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, 4, -1, -1, 6, -1, -1, 8, -1, 9, }, 85 /* _FX */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, }, 86 /* _FXC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, -1, -1, 5, -1, -1, 7, -1, 8, }, 87 /* _FD */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, }, 88 /* _FDC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, 2, -1, -1, 4, -1, -1, 6, -1, 7, }, 89 /* D */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, }, 90 /* DC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, -1, -1, 3, -1, -1, 5, -1, 6, }, 91 /* _FDX */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 4, 4, 5, 5, }, 92 /* _FDXC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 2, -1, -1, 4, -1, 5, }, 93 /* _F80 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 3, 3, 4, 4, }, 94 /* LD */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, 3, 3, }, 95 /* LDC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 2, -1, 3, }, 96 /* __FLD */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 2, }, 97 /* _FLD */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, }, 98 /* _FLDC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, }, 109 99 /* _FLDX */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, }, 110 100 /* _FLDXC */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, }, 111 101 }; // costMatrix 112 static const int maxIntCost = 25;102 static const int maxIntCost = 15; 113 103 // GENERATED END 114 104 static_assert( -
tests/arithmeticConversions.cfa
rde8a0a4b r0f070a4 98 98 printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n", 99 99 ST(f64xc), SZ(f64xc), SZ(f64xc + c), SZ(f64xc + sc), SZ(f64xc + uc), SZ(f64xc + ssi), SZ(f64xc + usi), SZ(f64xc + si), SZ(f64xc + ui), SZ(f64xc + sli), SZ(f64xc + ulli), SZ(f64xc + ulli), SZ(f64xc + ulli) ); 100 101 #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__) 100 #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__) 102 101 printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n", 103 102 ST(f80), SZ(f80), SZ(f80 + c), SZ(f80 + sc), SZ(f80 + uc), SZ(f80 + ssi), SZ(f80 + usi), SZ(f80 + si), SZ(f80 + ui), SZ(f80 + sli), SZ(f80 + ulli), SZ(f80 + ulli), SZ(f80 + ulli) ); 104 #endif 105 103 #endif 106 104 printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n", 107 105 ST(ld), SZ(ld), SZ(ld + c), SZ(ld + sc), SZ(ld + uc), SZ(ld + ssi), SZ(ld + usi), SZ(ld + si), SZ(ld + ui), SZ(ld + sli), SZ(ld + ulli), SZ(ld + ulli), SZ(ld + ulli) ); 108 106 printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n", 109 107 ST(ldc), SZ(ldc), SZ(ldc + c), SZ(ldc + sc), SZ(ldc + uc), SZ(ldc + ssi), SZ(ldc + usi), SZ(ldc + si), SZ(ldc + ui), SZ(ldc + sli), SZ(ldc + ulli), SZ(ldc + ulli), SZ(ldc + ulli) ); 110 111 #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__) 108 #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__) 112 109 printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n", 113 110 ST(uuf128), SZ(uuf128), SZ(uuf128 + c), SZ(uuf128 + sc), SZ(uuf128 + uc), SZ(uuf128 + ssi), SZ(uuf128 + usi), SZ(uuf128 + si), SZ(uuf128 + ui), SZ(uuf128 + sli), SZ(uuf128 + ulli), SZ(uuf128 + ulli), SZ(uuf128 + ulli) ); 114 #endif 115 111 #endif 116 112 printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n", 117 113 ST(f128), SZ(f128), SZ(f128 + c), SZ(f128 + sc), SZ(f128 + uc), SZ(f128 + ssi), SZ(f128 + usi), SZ(f128 + si), SZ(f128 + ui), SZ(f128 + sli), SZ(f128 + ulli), SZ(f128 + ulli), SZ(f128 + ulli) ); … … 150 146 printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd" OPT1(" %5zd") " %5zd %5zd" OPT1(" %6zd") " %5zd %5zd\n", 151 147 ST(f64xc), SZ(f64xc), SZ(f64xc + f32), SZ(f64xc + f32c), SZ(f64xc + f), SZ(f64xc + fc), SZ(f64xc + f32x), SZ(f64xc + f32xc), SZ(f64xc + f64), SZ(f64xc + f64c), SZ(f64xc + d), SZ(f64xc + dc), SZ(f64xc + f64x), SZ(f64xc + f64xc) OPT2(, SZ(f64xc + f80)), SZ(f64xc + ld), SZ(f64xc + ldc) OPT2(, SZ(f64xc + uuf128)), SZ(f64xc + f128), SZ(f64xc + f128c) ); 152 153 #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__) 148 #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__) 154 149 printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %6zd %5zd %5zd\n", 155 150 ST(f80), SZ(f80), SZ(f80 + f32), SZ(f80 + f32c), SZ(f80 + f), SZ(f80 + fc), SZ(f80 + f32x), SZ(f80 + f32xc), SZ(f80 + f64), SZ(f80 + f64c), SZ(f80 + d), SZ(f80 + dc), SZ(f80 + f64x), SZ(f80 + f64xc), SZ(f80 + f80), SZ(f80 + ld), SZ(f80 + ldc), SZ(f80 + uuf128), SZ(f80 + f128), SZ(f80 + f128c) ); 156 #endif 157 151 #endif 158 152 printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd" OPT1(" %5zd") " %5zd %5zd" OPT1(" %6zd") " %5zd %5zd\n", 159 153 ST(ld), SZ(ld), SZ(ld + f32), SZ(ld + f32c), SZ(ld + f), SZ(ld + fc), SZ(ld + f32x), SZ(ld + f32xc), SZ(ld + f64), SZ(ld + f64c), SZ(ld + d), SZ(ld + dc), SZ(ld + f64x), SZ(ld + f64xc) OPT2(, SZ(ld + f80)), SZ(ld + ld), SZ(ld + ldc) OPT2(, SZ(ld + uuf128)), SZ(ld + f128), SZ(ld + f128c) ); 160 154 printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd" OPT1(" %5zd") " %5zd %5zd" OPT1(" %6zd") " %5zd %5zd\n", 161 155 ST(ldc), SZ(ldc), SZ(ldc + f32), SZ(ldc + f32c), SZ(ldc + f), SZ(ldc + fc), SZ(ldc + f32x), SZ(ldc + f32xc), SZ(ldc + f64), SZ(ldc + f64c), SZ(ldc + d), SZ(ldc + dc), SZ(ldc + f64x), SZ(ldc + f64xc) OPT2(, SZ(ldc + f80)), SZ(ldc + ld), SZ(ldc + ldc) OPT2(, SZ(ldc + uuf128)), SZ(ldc + f128), SZ(ldc + f128c) ); 162 163 #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__) 156 #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__) 164 157 printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %6zd %5zd %5zd\n", 165 158 ST(uuf128), SZ(uuf128), SZ(uuf128 + f32), SZ(uuf128 + f32c), SZ(uuf128 + f), SZ(uuf128 + fc), SZ(uuf128 + f32x), SZ(uuf128 + f32xc), SZ(uuf128 + f64), SZ(uuf128 + f64c), SZ(uuf128 + d), SZ(uuf128 + dc), SZ(uuf128 + f64x), SZ(uuf128 + f64xc), SZ(uuf128 + f80), SZ(uuf128 + ld), SZ(uuf128 + ldc), SZ(uuf128 + uuf128), SZ(uuf128 + f128), SZ(uuf128 + f128c) ); 166 #endif 167 159 #endif 168 160 printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd" OPT1(" %5zd") " %5zd %5zd" OPT1(" %6zd") " %5zd %5zd\n", 169 161 ST(f128), SZ(f128), SZ(f128 + f32), SZ(f128 + f32c), SZ(f128 + f), SZ(f128 + fc), SZ(f128 + f32x), SZ(f128 + f32xc), SZ(f128 + f64), SZ(f128 + f64c), SZ(f128 + d), SZ(f128 + dc), SZ(f128 + f64x), SZ(f128 + f64xc) OPT2(, SZ(f128 + f80)), SZ(f128 + ld), SZ(f128 + ldc) OPT2(, SZ(f128 + uuf128)), SZ(f128 + f128), SZ(f128 + f128c) ); -
tests/array-collections/boxed.bookend.cfa
rde8a0a4b r0f070a4 27 27 static char * bookend_hi = 0p; 28 28 29 // bookend pointers are set to stack addresses and compared (but not dereferenced)30 // after their functions exit; they are "dangling"31 #pragma GCC diagnostic push32 #pragma GCC diagnostic ignored "-Wpragmas" // -Wdangling-pointer unrecognized until GCC 1233 #pragma GCC diagnostic ignored "-Wdangling-pointer"34 35 29 void bookendInner( void ) { 36 30 char var = 'x'; … … 41 35 #define TC(...) 42 36 #define TR( TRID, SZS, SZV, ETG, ACCS, SPS, OVLD ) \ 43 F_SIG( bookendOuter, TRID, SZS, SZV, ACCS, SPS, OVLD ) { \37 F_SIG( bookendOuter, TRID, SZS, SZV, ACCS, SPS, OVLD ) { \ 44 38 char var = 'x'; \ 45 39 (void) var; \ 46 40 bookend_hi = & var; \ 47 return CALL( allocAndAccess, TRID, SZS, n, expectedElmSz, tcid, vart ); \41 return CALL( allocAndAccess, TRID, SZS, n, expectedElmSz, tcid, vart ); \ 48 42 } 49 43 #include "boxed.cases.hfa" 50 44 #undef TC 51 45 #undef TR 52 53 #pragma GCC diagnostic pop54 46 55 47 void resetBookends( void ) { -
tests/malloc.cfa
rde8a0a4b r0f070a4 64 64 free( ip ); 65 65 66 #pragma GCC diagnostic push67 #pragma GCC diagnostic ignored "-Wpragmas" // -Walloc-size unrecognized until GCC 1468 #pragma GCC diagnostic ignored "-Walloc-size"69 66 ip = (int *)malloc( 0 ); 70 #pragma GCC diagnostic pop71 67 test_base( ip, 0, libAlign ); 72 68 test_use( ip );
Note:
See TracChangeset
for help on using the changeset viewer.