Changeset ef3403c6
- Timestamp:
- May 24, 2018, 10:34:36 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- b4f0dde
- Parents:
- c0a33d2
- Location:
- src/tests
- Files:
-
- 4 added
- 6 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
src/tests/.expect/io2.txt
rc0a33d2 ref3403c6 1 9 6 28 0 7 1 22 1 2 33 1234 1235 6 opening delimiters7 x (1 x [2 x {3 x =4 x $5 x £6 x ¥7 x ¡8 x ¿9 x «108 9 closing delimiters10 1, x 2. x 3; x 4! x 5? x 6% x 7¢ x 8» x 9) x 10] x 11} x11 12 opening/closing delimiters13 x`1`x'2'x"3"x:4:x 5 x 6 x14 715 x16 817 x18 919 x20 1021 x22 23 override opening/closing delimiters24 x ( 1 ) x 2 , x 3 :x: 425 26 1 input bacis types 27 2 -
src/tests/.expect/math1.x64.txt
rc0a33d2 ref3403c6 12 12 \ 16 256 13 13 \ 912673 256 64 -64 0.015625 -0.015625 18.3791736799526 0.264715-1.1922i 14 log:0 0 0 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i15 log2:3 3 316 log10:2 2 217 log1p:0.693147 0.693147180559945 0.69314718055994530918 ilogb:0 0 019 logb:3 3 320 sqrt:1 1 1 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i21 cbrt:3 3 322 hypot:1.41421 1.4142135623731 1.41421356237309505 -
src/tests/.expect/math2.x64.txt
rc0a33d2 ref3403c6 1 log:0 0 0 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i 2 log2:3 3 3 3 log10:2 2 2 4 log1p:0.693147 0.693147180559945 0.693147180559945309 5 ilogb:0 0 0 6 logb:3 3 3 7 sqrt:1 1 1 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i 8 cbrt:3 3 3 9 hypot:1.41421 1.4142135623731 1.41421356237309505 1 10 sin:0.841471 0.841470984807897 0.841470984807896507 1.29846+0.634964i 1.29845758141598+0.634963914784736i 1.29845758141597729+0.634963914784736108i 2 11 cos:0.540302 0.54030230586814 0.540302305868139717 0.83373-0.988898i 0.833730025131149-0.988897705762865i 0.833730025131149049-0.988897705762865096i … … 6 15 atan:0.785398 0.785398163397448 0.78539816339744831 1.01722+0.402359i 1.01722196789785+0.402359478108525i 1.01722196789785137+0.402359478108525094i 7 16 atan2:0.785398 0.785398163397448 0.78539816339744831 atan:0.785398 0.785398163397448 0.78539816339744831 8 sinh:1.1752 1.1752011936438 1.17520119364380146 0.634964+1.29846i 0.634963914784736+1.29845758141598i 0.634963914784736108+1.29845758141597729i9 cosh:1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i10 tanh:0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i11 acosh:0 0 0 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i12 asinh:0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i13 atanh:inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i14 erf:0.842701 0.842700792949715 0.84270079294971486915 erfc:0.157299 0.157299207050285 0.15729920705028513116 lgamma:1.79176 1.79175946922805 1.79175946922805517 lgamma:1.79176 1 1.79175946922805 1 1.791759469228055 118 tgamma:6 6 6 -
src/tests/.expect/math3.x64.txt
rc0a33d2 ref3403c6 1 floor:1 1 1 2 ceil:2 2 2 3 trunc:3 3 3 4 rint:2 2 2 5 rint:2 2 2 6 rint:2 2 2 7 lrint:2 2 2 8 llrint:2 2 2 9 nearbyint:4 4 4 10 round:2 2 2 11 round:2 2 2 12 round:2 2 2 13 lround:2 2 2 14 llround:2 2 2 15 copysign:-1 -1 -1 16 frexp:0.5 3 0.5 3 0.5 3 17 ldexp:8 8 8 18 modf:2 0.3 2 0.3 2 0.3 19 modf:2, 0.3 2, 0.3 2, 0.3 20 nextafter:2 2 2 21 nexttoward:2 2 2 22 scalbn:16 16 16 23 scalbln:16 16 16 1 sinh:1.1752 1.1752011936438 1.17520119364380146 0.634964+1.29846i 0.634963914784736+1.29845758141598i 0.634963914784736108+1.29845758141597729i 2 cosh:1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i 3 tanh:0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i 4 acosh:0 0 0 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i 5 asinh:0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i 6 atanh:inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i 7 erf:0.842701 0.842700792949715 0.842700792949714869 8 erfc:0.157299 0.157299207050285 0.157299207050285131 9 lgamma:1.79176 1.79175946922805 1.791759469228055 10 lgamma:1.79176 1 1.79175946922805 1 1.791759469228055 1 11 tgamma:6 6 6 -
src/tests/io2.c
rc0a33d2 ref3403c6 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // io .c --7 // io2.c -- 8 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Wed Mar 2 16:56:02 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jan 26 15:19:34201813 // Update Count : 10 012 // Last Modified On : Thu May 24 21:17:41 2018 13 // Update Count : 103 14 14 // 15 15 … … 37 37 enum { size = 10 }; 38 38 char s1[size], s2[size]; 39 40 int x = 3, y = 5, z = 7;41 sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl;42 sout | 1 | 2 | 3 | endl;43 sout | '1' | '2' | '3' | endl;44 sout | 1 | "" | 2 | "" | 3 | endl;45 sout | endl;46 47 sout | "opening delimiters" | endl;48 sout49 | "x (" | 150 | "x [" | 251 | "x {" | 352 | "x =" | 453 | "x $" | 554 | "x £" | 655 | "x ¥" | 756 | "x ¡" | 857 | "x ¿" | 958 | "x «" | 1059 | endl | endl;60 61 sout | "closing delimiters" | endl;62 sout63 | 1 | ", x"64 | 2 | ". x"65 | 3 | "; x"66 | 4 | "! x"67 | 5 | "? x"68 | 6 | "% x"69 | 7 | "¢ x"70 | 8 | "» x"71 | 9 | ") x"72 | 10 | "] x"73 | 11 | "} x"74 | endl | endl;75 76 sout | "opening/closing delimiters" | endl;77 sout78 | "x`" | 1 | "`x'" | 279 | "'x\"" | 3 | "\"x:" | 480 | ":x " | 5 | " x\t" | 681 | "\tx\f" | 7 | "\fx\v" | 882 | "\vx\n" | 9 | "\nx\r" | 1083 | "\rx"84 | endl | endl;85 86 sout | "override opening/closing delimiters" | endl;87 sout | "x ( " | 1 | " ) x" | 2 | " , x" | 3 | " :x: " | 4 | endl;88 sout | endl;89 39 90 40 ifstream in = { "io.data" }; // create / open file … … 181 131 // Local Variables: // 182 132 // tab-width: 4 // 183 // compile-command: "cfa io .c" //133 // compile-command: "cfa io2.c" // 184 134 // End: // -
src/tests/math1.c
rc0a33d2 ref3403c6 10 10 // Created On : Fri Apr 22 14:59:21 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 11 15:16:41 201713 // Update Count : 8 412 // Last Modified On : Thu May 24 21:01:15 2018 13 // Update Count : 85 14 14 // 15 15 … … 48 48 sout | "\\" | b | b \ e | endl; 49 49 sout | "\\" | 'a' \ 3u | 2 \ 8u | 4 \ 3u | -4 \ 3u | 4 \ -3 | -4 \ -3 | 4.0 \ 2.1 | (1.0f+2.0fi) \ (3.0f+2.0fi) | endl; 50 51 //---------------------- Logarithm ----------------------52 53 sout | "log:" | log( 1.0F ) | log( 1.0D ) | log( 1.0L ) | log( 1.0F+1.0FI ) | log( 1.0D+1.0DI ) | log( 1.0DL+1.0LI ) | endl;54 sout | "log2:" | log2( 8.0F ) | log2( 8.0D ) | log2( 8.0L ) | endl;55 sout | "log10:" | log10( 100.0F ) | log10( 100.0D ) | log10( 100.0L ) | endl;56 sout | "log1p:" | log1p( 1.0F ) | log1p( 1.0D ) | log1p( 1.0L ) | endl;57 sout | "ilogb:" | ilogb( 1.0F ) | ilogb( 1.0D ) | ilogb( 1.0L ) | endl;58 sout | "logb:" | logb( 8.0F ) | logb( 8.0D ) | logb( 8.0L ) | endl;59 60 sout | "sqrt:" | sqrt( 1.0F ) | sqrt( 1.0D ) | sqrt( 1.0L ) | sqrt( 1.0F+1.0FI ) | sqrt( 1.0D+1.0DI ) | sqrt( 1.0DL+1.0LI ) | endl;61 sout | "cbrt:" | cbrt( 27.0F ) | cbrt( 27.0D ) | cbrt( 27.0L ) | endl;62 sout | "hypot:" | hypot( 1.0F, -1.0F ) | hypot( 1.0D, -1.0D ) | hypot( 1.0L, -1.0L ) | endl;63 50 } // main 64 51 -
src/tests/math2.c
rc0a33d2 ref3403c6 10 10 // Created On : Fri Apr 22 14:59:21 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 11 15:40:04 201713 // Update Count : 8 112 // Last Modified On : Thu May 24 21:06:10 2018 13 // Update Count : 82 14 14 // 15 15 … … 21 21 double d; 22 22 long double l; 23 24 //---------------------- Logarithm ---------------------- 25 26 sout | "log:" | log( 1.0F ) | log( 1.0D ) | log( 1.0L ) | log( 1.0F+1.0FI ) | log( 1.0D+1.0DI ) | log( 1.0DL+1.0LI ) | endl; 27 sout | "log2:" | log2( 8.0F ) | log2( 8.0D ) | log2( 8.0L ) | endl; 28 sout | "log10:" | log10( 100.0F ) | log10( 100.0D ) | log10( 100.0L ) | endl; 29 sout | "log1p:" | log1p( 1.0F ) | log1p( 1.0D ) | log1p( 1.0L ) | endl; 30 sout | "ilogb:" | ilogb( 1.0F ) | ilogb( 1.0D ) | ilogb( 1.0L ) | endl; 31 sout | "logb:" | logb( 8.0F ) | logb( 8.0D ) | logb( 8.0L ) | endl; 32 33 sout | "sqrt:" | sqrt( 1.0F ) | sqrt( 1.0D ) | sqrt( 1.0L ) | sqrt( 1.0F+1.0FI ) | sqrt( 1.0D+1.0DI ) | sqrt( 1.0DL+1.0LI ) | endl; 34 sout | "cbrt:" | cbrt( 27.0F ) | cbrt( 27.0D ) | cbrt( 27.0L ) | endl; 35 sout | "hypot:" | hypot( 1.0F, -1.0F ) | hypot( 1.0D, -1.0D ) | hypot( 1.0L, -1.0L ) | endl; 23 36 24 37 //---------------------- Trigonometric ---------------------- … … 32 45 sout | "atan2:" | atan2( 1.0F, 1.0F ) | atan2( 1.0D, 1.0D ) | atan2( 1.0L, 1.0L ); 33 46 sout | "atan:" | atan( 1.0F, 1.0F ) | atan( 1.0D, 1.0D ) | atan( 1.0L, 1.0L ) | endl; 34 35 //---------------------- Hyperbolic ----------------------36 37 sout | "sinh:" | sinh( 1.0F ) | sinh( 1.0D ) | sinh( 1.0L ) | sinh( 1.0F+1.0FI ) | sinh( 1.0D+1.0DI ) | sinh( 1.0DL+1.0LI ) | endl;38 sout | "cosh:" | cosh( 1.0F ) | cosh( 1.0D ) | cosh( 1.0L ) | cosh( 1.0F+1.0FI ) | cosh( 1.0D+1.0DI ) | cosh( 1.0DL+1.0LI ) | endl;39 sout | "tanh:" | tanh( 1.0F ) | tanh( 1.0D ) | tanh( 1.0L ) | tanh( 1.0F+1.0FI ) | tanh( 1.0D+1.0DI ) | tanh( 1.0DL+1.0LI ) | endl;40 sout | "acosh:" | acosh( 1.0F ) | acosh( 1.0D ) | acosh( 1.0L ) | acosh( 1.0F+1.0FI ) | acosh( 1.0D+1.0DI ) | acosh( 1.0DL+1.0LI ) | endl;41 sout | "asinh:" | asinh( 1.0F ) | asinh( 1.0D ) | asinh( 1.0L ) | asinh( 1.0F+1.0FI ) | asinh( 1.0D+1.0DI ) | asinh( 1.0DL+1.0LI ) | endl;42 sout | "atanh:" | atanh( 1.0F ) | atanh( 1.0D ) | atanh( 1.0L ) | atanh( 1.0F+1.0FI ) | atanh( 1.0D+1.0DI ) | atanh( 1.0DL+1.0LI ) | endl;43 44 //---------------------- Error / Gamma ----------------------45 46 sout | "erf:" | erf( 1.0F ) | erf( 1.0D ) | erf( 1.0L ) | endl;47 sout | "erfc:" | erfc( 1.0F ) | erfc( 1.0D ) | erfc( 1.0L ) | endl;48 sout | "lgamma:" | lgamma( 4.0F ) | lgamma( 4.0D ) | lgamma( 4.0L ) | endl;49 int sign;50 f = lgamma( 4.0F, &sign );51 sout | "lgamma:" | f | sign;52 d = lgamma( 4.0D, &sign );53 sout | d | sign;54 l = lgamma( 4.0L, &sign );55 sout | l | sign | endl;56 sout | "tgamma:" | tgamma( 4.0F ) | tgamma( 4.0D ) | tgamma( 4.0L ) | endl;57 47 } // main 58 48 -
src/tests/math3.c
rc0a33d2 ref3403c6 10 10 // Created On : Fri Apr 22 14:59:21 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 11 15:40:03 201713 // Update Count : 8 112 // Last Modified On : Thu May 24 21:06:12 2018 13 // Update Count : 82 14 14 // 15 15 … … 22 22 long double l; 23 23 24 //---------------------- Nearest Integer----------------------24 //---------------------- Hyperbolic ---------------------- 25 25 26 sout | "floor:" | floor( 1.2F ) | floor( 1.2D ) | floor( 1.2L ) | endl; 27 sout | "ceil:" | ceil( 1.6F ) | ceil( 1.6D ) | ceil( 1.6L ) | endl; 28 sout | "trunc:" | trunc( 3.5F ) | trunc( 3.5D ) | trunc( 3.5L ) | endl; 29 sout | "rint:" | (float)rint( 1.5F ) | (double)rint( 1.5D ) | (long double)rint( 1.5L ) | endl; 30 sout | "rint:" | (long int)rint( 1.5F ) | (long int)rint( 1.5D ) | (long int)rint( 1.5L ) | endl; 31 sout | "rint:" | (long long int)rint( 1.5F ) | (long long int)rint( 1.5D ) | (long long int)rint( 1.5L ) | endl; 32 sout | "lrint:" | lrint( 1.5F ) | lrint( 1.5D ) | lrint( 1.5L ) | endl; 33 sout | "llrint:" | llrint( 1.5F ) | llrint( 1.5D ) | llrint( 1.5L ) | endl; 34 sout | "nearbyint:" | nearbyint( 3.5F ) | nearbyint( 3.5D ) | nearbyint( 3.5L ) | endl; 35 sout | "round:" | (float)round( 1.5F ) | (double)round( 1.5D ) | (long double)round( 1.5L ) | endl; 36 sout | "round:" | (long int)round( 1.5F ) | (long int)round( 1.5D ) | (long int)round( 1.5L ) | endl; 37 sout | "round:" | (long long int)round( 1.5F ) | (long long int)round( 1.5D ) | (long long int)round( 1.5L ) | endl; 38 sout | "lround:" | lround( 1.5F ) | lround( 1.5D ) | lround( 1.5L ) | endl; 39 sout | "llround:" | llround( 1.5F ) | llround( 1.5D ) | llround( 1.5L ) | endl; 26 sout | "sinh:" | sinh( 1.0F ) | sinh( 1.0D ) | sinh( 1.0L ) | sinh( 1.0F+1.0FI ) | sinh( 1.0D+1.0DI ) | sinh( 1.0DL+1.0LI ) | endl; 27 sout | "cosh:" | cosh( 1.0F ) | cosh( 1.0D ) | cosh( 1.0L ) | cosh( 1.0F+1.0FI ) | cosh( 1.0D+1.0DI ) | cosh( 1.0DL+1.0LI ) | endl; 28 sout | "tanh:" | tanh( 1.0F ) | tanh( 1.0D ) | tanh( 1.0L ) | tanh( 1.0F+1.0FI ) | tanh( 1.0D+1.0DI ) | tanh( 1.0DL+1.0LI ) | endl; 29 sout | "acosh:" | acosh( 1.0F ) | acosh( 1.0D ) | acosh( 1.0L ) | acosh( 1.0F+1.0FI ) | acosh( 1.0D+1.0DI ) | acosh( 1.0DL+1.0LI ) | endl; 30 sout | "asinh:" | asinh( 1.0F ) | asinh( 1.0D ) | asinh( 1.0L ) | asinh( 1.0F+1.0FI ) | asinh( 1.0D+1.0DI ) | asinh( 1.0DL+1.0LI ) | endl; 31 sout | "atanh:" | atanh( 1.0F ) | atanh( 1.0D ) | atanh( 1.0L ) | atanh( 1.0F+1.0FI ) | atanh( 1.0D+1.0DI ) | atanh( 1.0DL+1.0LI ) | endl; 40 32 41 //---------------------- Manipulation----------------------33 //---------------------- Error / Gamma ---------------------- 42 34 43 sout | "copysign:" | copysign( 1.0F, -1.0F ) | copysign( 1.0D, -1.0D ) | copysign( 1.0L, -1.0L ) | endl; 44 int exp; 45 f = frexp( 4.0F, &exp ); 46 sout | "frexp:" | f | exp; 47 d = frexp( 4.0D, &exp ); 48 sout | d | exp; 49 l = frexp( 4.0L, &exp ); 50 sout | l | exp | endl; 51 sout | "ldexp:" | ldexp( 2.0F, 2 ) | ldexp( 2.0D, 2 ) | ldexp( 2.0L, 2 ) | endl; 52 float fi; 53 double di; 54 long double ldi; 55 f = modf( 2.3F, &fi ); 56 sout | "modf:" | fi | f; 57 d = modf( 2.3D, &di ); 58 sout | di | d; 59 l = modf( 2.3L, &ldi ); 60 sout | ldi | l | endl; 61 sout | "modf:" | modf( 2.3F ) | modf( 2.3D ) | modf( 2.3L ) | endl; 62 sout | "nextafter:" | nextafter( 2.0F, 3.0F ) | nextafter( 2.0D, 3.0D ) | nextafter( 2.0L, 3.0L ) | endl; 63 sout | "nexttoward:" | nexttoward( 2.0F, 3.0F ) | nexttoward( 2.0D, 3.0D ) | nexttoward( 2.0L, 3.0L ) | endl; 64 65 sout | "scalbn:" | scalbn( 2.0F, 3 ) | scalbn( 2.0D, 3 ) | scalbn( 2.0L, 3 ) | endl; 66 sout | "scalbln:" | scalbln( 2.0F, 3L ) | scalbln( 2.0D, 3L ) | scalbln( 2.0L, 3L ) | endl; 35 sout | "erf:" | erf( 1.0F ) | erf( 1.0D ) | erf( 1.0L ) | endl; 36 sout | "erfc:" | erfc( 1.0F ) | erfc( 1.0D ) | erfc( 1.0L ) | endl; 37 sout | "lgamma:" | lgamma( 4.0F ) | lgamma( 4.0D ) | lgamma( 4.0L ) | endl; 38 int sign; 39 f = lgamma( 4.0F, &sign ); 40 sout | "lgamma:" | f | sign; 41 d = lgamma( 4.0D, &sign ); 42 sout | d | sign; 43 l = lgamma( 4.0L, &sign ); 44 sout | l | sign | endl; 45 sout | "tgamma:" | tgamma( 4.0F ) | tgamma( 4.0D ) | tgamma( 4.0L ) | endl; 67 46 } // main 68 47
Note: See TracChangeset
for help on using the changeset viewer.