diff --git a/test/libsolidity/semanticTests/literals/denominations.sol b/test/libsolidity/semanticTests/literals/denominations.sol new file mode 100644 index 000000000..256525cb9 --- /dev/null +++ b/test/libsolidity/semanticTests/literals/denominations.sol @@ -0,0 +1,9 @@ +contract C { + uint constant x = 1 ether + 1 gwei + 1 wei; + + function f() public view returns(uint) { return x; } +} +// ==== +// compileViaYul: also +// ---- +// f() -> 1000000001000000001 diff --git a/test/libsolidity/semanticTests/literals/ether.sol b/test/libsolidity/semanticTests/literals/ether.sol new file mode 100644 index 000000000..f03171796 --- /dev/null +++ b/test/libsolidity/semanticTests/literals/ether.sol @@ -0,0 +1,9 @@ +contract C { + uint constant x = 1 ether; + + function f() public view returns(uint) { return x; } +} +// ==== +// compileViaYul: also +// ---- +// f() -> 1000000000000000000 diff --git a/test/libsolidity/semanticTests/literals/wei.sol b/test/libsolidity/semanticTests/literals/wei.sol new file mode 100644 index 000000000..59af2a3d7 --- /dev/null +++ b/test/libsolidity/semanticTests/literals/wei.sol @@ -0,0 +1,9 @@ +contract C { + uint constant x = 1 wei; + + function f() public view returns(uint) { return x; } +} +// ==== +// compileViaYul: also +// ---- +// f() -> 1