From 106e0101bf4235d406738c1400423632c435ec80 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Mon, 16 Aug 2021 16:10:17 +0200 Subject: [PATCH] Some more tests. --- .../early_push_on_deep_swap.yul | 55 +++++++++++++++++++ .../nonempty_initial_layout.yul | 12 ++++ 2 files changed, 67 insertions(+) create mode 100644 test/libyul/evmCodeTransform/early_push_on_deep_swap.yul create mode 100644 test/libyul/evmCodeTransform/nonempty_initial_layout.yul diff --git a/test/libyul/evmCodeTransform/early_push_on_deep_swap.yul b/test/libyul/evmCodeTransform/early_push_on_deep_swap.yul new file mode 100644 index 000000000..562a56509 --- /dev/null +++ b/test/libyul/evmCodeTransform/early_push_on_deep_swap.yul @@ -0,0 +1,55 @@ +{ + extcodecopy(div(div(call(call(gas(),0x10000000000000000000000000000000000000000000000000, 0x100000000000000000000000000000000000000000000000000, 0x1000000000000000000000000000000000000000000000000000, 0x10000000000000000000000000000000000000000000000000000, 0x100000000000000000000000000000000000000000000000000000, 0x1000000000000000000000000000000000000000000000000000000), 0x10000000000000000000000000000000000000000000000000000000, 0x100000000000000000000000000000000000000000000000000000000, 0x1000000000000000000000000000000000000000000000000000000000, 0x10000000000000000000000000000000000000000000000000000000000, 0x100000000000000000000000000000000000000000000000000000000000, 0x1000000000000000000000000000000000000000000000000000000000000),0x10000000000000000000000000000000000000000000000000000000000000),0x100000000000000000000000000000000000000000000000000000000000000), 0x1000000000000000000000000000000000000000000000000000000000000000, 0x1000000000000000000000000000000000000000000000000000000000000001, 0x100000000000000000000000000000000000000000000000000000000000001) +} +// ==== +// stackOptimization: true +// ---- +// /* "":36:41 */ +// gas +// /* "":959:1025 */ +// 0x1000000000000000000000000000000000000000000000000000000000000001 +// /* "":891:957 */ +// 0x1000000000000000000000000000000000000000000000000000000000000000 +// /* "":823:888 */ +// 0x0100000000000000000000000000000000000000000000000000000000000000 +// /* "":757:821 */ +// 0x10000000000000000000000000000000000000000000000000000000000000 +// /* "":692:755 */ +// 0x01000000000000000000000000000000000000000000000000000000000000 +// /* "":628:690 */ +// 0x100000000000000000000000000000000000000000000000000000000000 +// /* "":565:626 */ +// 0x010000000000000000000000000000000000000000000000000000000000 +// /* "":503:563 */ +// 0x1000000000000000000000000000000000000000000000000000000000 +// /* "":442:501 */ +// 0x0100000000000000000000000000000000000000000000000000000000 +// /* "":382:440 */ +// 0x10000000000000000000000000000000000000000000000000000000 +// /* "":322:379 */ +// 0x01000000000000000000000000000000000000000000000000000000 +// /* "":264:320 */ +// 0x100000000000000000000000000000000000000000000000000000 +// /* "":207:262 */ +// 0x010000000000000000000000000000000000000000000000000000 +// /* "":151:205 */ +// 0x1000000000000000000000000000000000000000000000000000 +// /* "":96:149 */ +// 0x0100000000000000000000000000000000000000000000000000 +// /* "":1027:1092 */ +// 0x0100000000000000000000000000000000000000000000000000000000000001 +// swap16 +// /* "":42:94 */ +// 0x10000000000000000000000000000000000000000000000000 +// swap1 +// /* "":31:380 */ +// call +// /* "":26:756 */ +// call +// /* "":22:822 */ +// div +// /* "":18:889 */ +// div +// /* "":6:1093 */ +// extcodecopy +// stop diff --git a/test/libyul/evmCodeTransform/nonempty_initial_layout.yul b/test/libyul/evmCodeTransform/nonempty_initial_layout.yul new file mode 100644 index 000000000..c5daa9c2b --- /dev/null +++ b/test/libyul/evmCodeTransform/nonempty_initial_layout.yul @@ -0,0 +1,12 @@ +{ + if 0x2000000000000000000000000000000000000000000000000000000000 {} +} +// ==== +// stackOptimization: true +// ---- +// /* "":9:69 */ +// jumpi(tag_1, 0x2000000000000000000000000000000000000000000000000000000000) +// tag_2: +// stop +// tag_1: +// jump(tag_2)