-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move math cast tests into separate file
- Loading branch information
Showing
6 changed files
with
122 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#pragma once | ||
|
||
type E as long | ||
enum | ||
ENUMCONST1 = 0 | ||
end enum | ||
|
||
const A58 = culng(0u - 100u) | ||
const A59 = culng(0u - 100) | ||
const A60 = 0 - 100 | ||
const A61 = culng(0 - 100u) | ||
const A62 = culng(0u - 100u) | ||
const A70 = culng(A58 - 1u) | ||
const A71 = culng(A58 - 1) | ||
const A72 = culng(culng(A58) - 1u) | ||
const A73 = culng(culng(A58) - 1) | ||
const A74 = culng(ENUMCONST1 - 1u) | ||
const A75 = ENUMCONST1 - 1 | ||
const A76 = culng(culng(ENUMCONST1) - 1u) | ||
const A77 = culng(culng(ENUMCONST1) - 1) | ||
#define A78 (undefined - 1u) | ||
#define A79 (undefined - 1) | ||
#define A80 culng(culng(undefined) - 1u) | ||
#define A81 culng(culng(undefined) - 1) | ||
#define A82 culng(clng(undefined) - 1u) | ||
#define A83 (clng(undefined) - 1) | ||
|
||
#ifdef __FB_WIN32__ | ||
#define A84 undefined | ||
#define A85 A84 | ||
#else | ||
const A84 = -1 | ||
const A85 = A84 | ||
#endif | ||
|
||
const B00 = culng(0u - 100u) | ||
const B01 = B00 | ||
#define B11 culng(B10 - 1) | ||
const B10 = culng(0u - 100u) | ||
#define B22 culng(B21 - 1) | ||
#define B21 culng(B20 - 1) | ||
const B20 = culng(0u - 100u) | ||
#define B31 culng(B30 - 1) | ||
#define B32 culng(B31 - 1) | ||
const B30 = culng(0u - 100u) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
enum E { | ||
ENUMCONST1 = 0, | ||
}; | ||
|
||
// A culng() cast needs to be added around this BOP, to ensure the result is | ||
// truncated to 32bit in FB 64bit | ||
#define A58 (0u - 100u) | ||
#define A59 (0u - 100) | ||
#define A60 (0 - 100) | ||
#define A61 (0 - 100u) | ||
|
||
// Similar situation here - but the cast is already there, and we shouldn't add | ||
// another one. | ||
#define A62 ((unsigned int)(0u - 100u)) | ||
|
||
// Expression type depending on the type of an existing symbol | ||
#define A70 (A58 - 1u) | ||
#define A71 (A58 - 1) | ||
#define A72 ((unsigned int) A58 - 1u) | ||
#define A73 ((unsigned int) A58 - 1) | ||
#define A74 (ENUMCONST1 - 1u) | ||
#define A75 (ENUMCONST1 - 1) | ||
#define A76 ((unsigned int)ENUMCONST1 - 1u) | ||
#define A77 ((unsigned int)ENUMCONST1 - 1) | ||
#define A78 (undefined - 1u) | ||
#define A79 (undefined - 1) | ||
#define A80 ((unsigned int)undefined - 1u) | ||
#define A81 ((unsigned int)undefined - 1) | ||
#define A82 ((int)undefined - 1u) | ||
#define A83 ((int)undefined - 1) | ||
#ifdef _WIN32 | ||
#define A84 undefined | ||
#else | ||
#define A84 (-1) | ||
#endif | ||
#define A85 A84 | ||
|
||
// Same but with forward references | ||
#define B01 B00 // simple alias | ||
#define B00 (0u - 100u) | ||
|
||
#define B11 (B10 - 1) // "complex" math expression | ||
#define B10 (0u - 100u) | ||
|
||
#define B22 (B21 - 1) // extra indirection level | ||
#define B21 (B20 - 1) | ||
#define B20 (0u - 100u) | ||
|
||
#define B31 (B30 - 1) | ||
#define B32 (B31 - 1) // isn't a fwdref itself, but refers to one | ||
#define B30 (0u - 100u) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[ 1/23] linux-x86 | ||
[ 2/23] linux-x86_64 | ||
[ 3/23] linux-arm | ||
[ 4/23] linux-aarch64 | ||
[ 5/23] freebsd-x86 | ||
[ 6/23] freebsd-x86_64 | ||
[ 7/23] freebsd-arm | ||
[ 8/23] freebsd-aarch64 | ||
[ 9/23] openbsd-x86 | ||
[10/23] openbsd-x86_64 | ||
[11/23] openbsd-arm | ||
[12/23] openbsd-aarch64 | ||
[13/23] netbsd-x86 | ||
[14/23] netbsd-x86_64 | ||
[15/23] netbsd-arm | ||
[16/23] netbsd-aarch64 | ||
[17/23] darwin-x86 | ||
[18/23] darwin-x86_64 | ||
[19/23] win32 | ||
[20/23] win64 | ||
[21/23] cygwin-x86 | ||
[22/23] cygwin-x86_64 | ||
[23/23] dos | ||
tests/highlevel/math-casts.h | ||
emitting: tests/highlevel/math-casts.bi (34 declarations, 0 TODOs) |