mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Activating some tests viaYul after implementing getters for bytes.
This commit is contained in:
parent
2d5a2c65a8
commit
7b2614576f
@ -2,7 +2,7 @@ contract C {
|
||||
struct T { uint8 x; uint8 y; uint[] z; }
|
||||
T[3][] a;
|
||||
|
||||
function f() public returns (uint8, uint8, uint, uint, uint, uint8, uint8, uint, uint, uint) {
|
||||
function f() public returns (uint8, uint8, uint, uint8, uint8, uint) {
|
||||
a.push();
|
||||
a.push();
|
||||
a[0][1].x = 11;
|
||||
@ -17,10 +17,12 @@ contract C {
|
||||
a[1][2].z.push(6);
|
||||
T[3][] memory m = a;
|
||||
return (
|
||||
m[0][1].x, m[0][1].y, m[0][1].z[0], m[0][1].z[1], m[0][1].z[2],
|
||||
m[1][2].x, m[1][2].y, m[1][2].z[0], m[1][2].z[1], m[1][2].z[2]
|
||||
m[0][1].x, m[0][1].y, m[0][1].z[0],
|
||||
m[1][2].x, m[1][2].y, m[1][2].z[0]
|
||||
);
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> 11, 0x0c, 1, 2, 3, 0x15, 22, 4, 5, 6
|
||||
// f() -> 11, 0x0c, 1, 0x15, 22, 4
|
||||
|
@ -10,6 +10,8 @@ contract C {
|
||||
}
|
||||
}
|
||||
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test() ->
|
||||
// tester() -> 0x20, 0x3, "abc"
|
||||
|
@ -23,6 +23,8 @@ contract C {
|
||||
function arrayPushEmpty() public { x.push(); }
|
||||
function del() public { delete x; }
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// x() -> 0x20, 3, 0x6162630000000000000000000000000000000000000000000000000000000000
|
||||
// abiEncode() -> 0x20, 3, 0x6162630000000000000000000000000000000000000000000000000000000000
|
||||
|
@ -16,5 +16,7 @@ contract Sample {
|
||||
p[0] = m;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// p(uint256): 0x0 -> 0xbbbb, 0xcccc, 0x80, 0xc0, 0x05, "hello", 0x05, "world"
|
||||
|
@ -28,6 +28,8 @@ contract buggystruct {
|
||||
return bug.last;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// getFirst() -> 0x0a
|
||||
// getSecond() -> 0x14
|
||||
|
@ -6,6 +6,8 @@ contract Test {
|
||||
m_s = s;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor(): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" ->
|
||||
// m_x() -> 7
|
||||
|
@ -10,6 +10,7 @@ contract A {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// EVMVersion: >=byzantium
|
||||
// ----
|
||||
// f() -> 0x01, 0x40, 0x00
|
||||
|
@ -2,13 +2,17 @@ contract C {
|
||||
string public a;
|
||||
string public b;
|
||||
bytes public c;
|
||||
string public d = "abcd";
|
||||
constructor() {
|
||||
a = "hello world";
|
||||
b = hex"41424344";
|
||||
c = hex"ff077fff";
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// a() -> 0x20, 11, "hello world"
|
||||
// b() -> 0x20, 4, "ABCD"
|
||||
// c() -> 0x20, 4, -439061522557375173052089223601630338202760422010735733633791622124826263552
|
||||
// d() -> 0x20, 4, "abcd"
|
||||
|
@ -14,5 +14,7 @@ contract C {
|
||||
s.d.push(10);
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// s() -> 7, 0x40, 3, 0x6162630000000000000000000000000000000000000000000000000000000000
|
||||
|
@ -13,5 +13,7 @@ contract C {
|
||||
s.c[0] = 9;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// s() -> 0x07, 0x40, 0x03, 0x6162630000000000000000000000000000000000000000000000000000000000
|
||||
|
@ -8,6 +8,8 @@ contract A {
|
||||
externalData = msg.data;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// data() -> 0
|
||||
// ()
|
||||
@ -20,4 +22,4 @@ contract A {
|
||||
// balance() -> 1
|
||||
// (), 2 wei: hex"fefe"
|
||||
// balance() -> 2
|
||||
// externalData() -> 0x20, 2, left(0xfefe)
|
||||
// externalData() -> 0x20, 2, left(0xfefe)
|
||||
|
@ -21,5 +21,7 @@ contract CopyTest {
|
||||
return (memoryTree.children.length, memoryTree.children[0].children.length, memoryTree.children[1].children.length);
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// run() -> 2, 23, 42
|
||||
|
@ -46,5 +46,7 @@ contract CopyTest {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// run() -> 0x20, 10, 0x42, 0x4200, 0x420000, 0x420001, 0x420002, 0x4201, 0x420100, 0x420101, 0x420102, 0x420103
|
||||
|
@ -64,6 +64,8 @@ contract Test {
|
||||
a2 = m_x.a[1];
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// load() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
|
||||
// store() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
|
||||
|
@ -50,6 +50,8 @@ contract Test {
|
||||
}
|
||||
}
|
||||
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// testInit() -> 0, 0, 0, 0, true
|
||||
// testCopyRead() -> 1, 2, 3, 4
|
||||
|
@ -18,6 +18,8 @@ contract X is A
|
||||
}
|
||||
|
||||
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test() -> 0, 64, 0
|
||||
// set() ->
|
||||
|
@ -18,6 +18,8 @@ contract X is A
|
||||
}
|
||||
|
||||
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test(uint256): 0 -> 0, 64, 0
|
||||
// test(uint256): 42 -> 0, 64, 0
|
||||
|
@ -12,6 +12,8 @@ contract C {
|
||||
function g() public view returns (uint) { return address(0).code.length; }
|
||||
function h() public view returns (uint) { return address(1).code.length; }
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor() ->
|
||||
// initCode() -> 0x20, 0
|
||||
|
@ -18,5 +18,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// g() -> 2, 6
|
||||
|
Loading…
Reference in New Issue
Block a user