-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[move-compiler-v2] Add all remaining V1 tests to V2, except evm/async (…
…#14578) * add options and plumbing for compile_verify_code, warn_deprecated, etc., and add final set of V1 tests to V2, except flavor tests (evm/async) * move around and edit/split tests to test same functionality in V2 as V1
- Loading branch information
1 parent
eab8d27
commit 2b208e5
Showing
953 changed files
with
13,535 additions
and
1,432 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
third_party/move/move-compiler-v2/tests/ability-check/typing/assign_unpack_references.exp
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,13 @@ | ||
|
||
Diagnostics: | ||
error: value of type `M::R` does not have the `drop` ability | ||
┌─ tests/ability-check/typing/assign_unpack_references.move:17:33 | ||
│ | ||
17 │ R { s1: S { f }, s2 } = &R { s1: S{f: 0}, s2: S{f: 1} }; f; s2; | ||
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ still borrowed but will be implicitly dropped later since it is no longer used | ||
|
||
error: value of type `M::R` does not have the `drop` ability | ||
┌─ tests/ability-check/typing/assign_unpack_references.move:27:33 | ||
│ | ||
27 │ R { s1: S { f }, s2 } = &mut R { s1: S{f: 0}, s2: S{f: 1} }; f; s2; | ||
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ still borrowed but will be implicitly dropped later since it is no longer used |
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
third_party/move/move-compiler-v2/tests/ability-check/typing/bind_unpack_references.exp
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,13 @@ | ||
|
||
Diagnostics: | ||
error: value of type `M::R` does not have the `drop` ability | ||
┌─ tests/ability-check/typing/bind_unpack_references.move:13:41 | ||
│ | ||
13 │ let R { s1: S { f }, s2 }: &R = &R { s1: S{f: 0}, s2: S{f: 1} }; f; s2; | ||
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ still borrowed but will be implicitly dropped later since it is no longer used | ||
|
||
error: value of type `M::R` does not have the `drop` ability | ||
┌─ tests/ability-check/typing/bind_unpack_references.move:20:45 | ||
│ | ||
20 │ let R { s1: S { f }, s2 }: &mut R = &mut R { s1: S{f: 0}, s2: S{f: 1} }; f; s2; | ||
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ still borrowed but will be implicitly dropped later since it is no longer used |
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
third_party/move/move-compiler-v2/tests/ability-check/typing/borrow_local_temp_resource.exp
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,13 @@ | ||
|
||
Diagnostics: | ||
error: value of type `M::R` does not have the `drop` ability | ||
┌─ tests/ability-check/typing/borrow_local_temp_resource.move:6:9 | ||
│ | ||
6 │ &R{}; | ||
│ ^^^^ implicitly dropped here since it is no longer used | ||
|
||
error: value of type `M::R` does not have the `drop` ability | ||
┌─ tests/ability-check/typing/borrow_local_temp_resource.move:7:9 | ||
│ | ||
7 │ &mut R{}; | ||
│ ^^^^^^^^ implicitly dropped here since it is no longer used |
File renamed without changes.
43 changes: 43 additions & 0 deletions
43
third_party/move/move-compiler-v2/tests/ability-check/typing/derefrence_reference.exp
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,43 @@ | ||
|
||
Diagnostics: | ||
error: local `r` of type `M::R` does not have the `copy` ability | ||
┌─ tests/ability-check/typing/derefrence_reference.move:6:16 | ||
│ | ||
6 │ R {} = *r; | ||
│ ^^ reference content copied here | ||
|
||
error: local `b` of type `M::B` does not have the `copy` ability | ||
┌─ tests/ability-check/typing/derefrence_reference.move:7:24 | ||
│ | ||
7 │ B { r: R{} } = *b; | ||
│ ^^ reference content copied here | ||
|
||
error: value of type `M::R` does not have the `copy` ability | ||
┌─ tests/ability-check/typing/derefrence_reference.move:8:17 | ||
│ | ||
8 │ R{} = *&b.r; | ||
│ ^^^ reference content copied here | ||
|
||
error: local `r` of type `M::R` does not have the `copy` ability | ||
┌─ tests/ability-check/typing/derefrence_reference.move:12:16 | ||
│ | ||
12 │ R {} = *r; | ||
│ ^^ reference content copied here | ||
|
||
error: local `b` of type `M::B` does not have the `copy` ability | ||
┌─ tests/ability-check/typing/derefrence_reference.move:13:24 | ||
│ | ||
13 │ B { r: R{} } = *b; | ||
│ ^^ reference content copied here | ||
|
||
error: value of type `M::R` does not have the `copy` ability | ||
┌─ tests/ability-check/typing/derefrence_reference.move:14:17 | ||
│ | ||
14 │ R{} = *&b.r; | ||
│ ^^^ reference content copied here | ||
|
||
error: value of type `M::R` does not have the `copy` ability | ||
┌─ tests/ability-check/typing/derefrence_reference.move:15:21 | ||
│ | ||
15 │ R{} = *&mut b.r; | ||
│ ^^^ reference content copied here |
File renamed without changes.
43 changes: 43 additions & 0 deletions
43
third_party/move/move-compiler-v2/tests/ability-check/typing/derefrence_reference.no-opt.exp
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,43 @@ | ||
|
||
Diagnostics: | ||
error: local `r` of type `M::R` does not have the `copy` ability | ||
┌─ tests/reference-safety/derefrence_reference.move:6:16 | ||
│ | ||
6 │ R {} = *r; | ||
│ ^^ reference content copied here | ||
|
||
error: local `b` of type `M::B` does not have the `copy` ability | ||
┌─ tests/reference-safety/derefrence_reference.move:7:24 | ||
│ | ||
7 │ B { r: R{} } = *b; | ||
│ ^^ reference content copied here | ||
|
||
error: value of type `M::R` does not have the `copy` ability | ||
┌─ tests/reference-safety/derefrence_reference.move:8:17 | ||
│ | ||
8 │ R{} = *&b.r; | ||
│ ^^^ reference content copied here | ||
|
||
error: local `r` of type `M::R` does not have the `copy` ability | ||
┌─ tests/reference-safety/derefrence_reference.move:12:16 | ||
│ | ||
12 │ R {} = *r; | ||
│ ^^ reference content copied here | ||
|
||
error: local `b` of type `M::B` does not have the `copy` ability | ||
┌─ tests/reference-safety/derefrence_reference.move:13:24 | ||
│ | ||
13 │ B { r: R{} } = *b; | ||
│ ^^ reference content copied here | ||
|
||
error: value of type `M::R` does not have the `copy` ability | ||
┌─ tests/reference-safety/derefrence_reference.move:14:17 | ||
│ | ||
14 │ R{} = *&b.r; | ||
│ ^^^ reference content copied here | ||
|
||
error: value of type `M::R` does not have the `copy` ability | ||
┌─ tests/reference-safety/derefrence_reference.move:15:21 | ||
│ | ||
15 │ R{} = *&mut b.r; | ||
│ ^^^ reference content copied here |
43 changes: 43 additions & 0 deletions
43
third_party/move/move-compiler-v2/tests/ability-check/typing/derefrence_reference.old.exp
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,43 @@ | ||
|
||
Diagnostics: | ||
error: local `r` of type `M::R` does not have the `copy` ability | ||
┌─ tests/reference-safety/derefrence_reference.move:6:16 | ||
│ | ||
6 │ R {} = *r; | ||
│ ^^ reference content copied here | ||
|
||
error: local `b` of type `M::B` does not have the `copy` ability | ||
┌─ tests/reference-safety/derefrence_reference.move:7:24 | ||
│ | ||
7 │ B { r: R{} } = *b; | ||
│ ^^ reference content copied here | ||
|
||
error: value of type `M::R` does not have the `copy` ability | ||
┌─ tests/reference-safety/derefrence_reference.move:8:17 | ||
│ | ||
8 │ R{} = *&b.r; | ||
│ ^^^ reference content copied here | ||
|
||
error: local `r` of type `M::R` does not have the `copy` ability | ||
┌─ tests/reference-safety/derefrence_reference.move:12:16 | ||
│ | ||
12 │ R {} = *r; | ||
│ ^^ reference content copied here | ||
|
||
error: local `b` of type `M::B` does not have the `copy` ability | ||
┌─ tests/reference-safety/derefrence_reference.move:13:24 | ||
│ | ||
13 │ B { r: R{} } = *b; | ||
│ ^^ reference content copied here | ||
|
||
error: value of type `M::R` does not have the `copy` ability | ||
┌─ tests/reference-safety/derefrence_reference.move:14:17 | ||
│ | ||
14 │ R{} = *&b.r; | ||
│ ^^^ reference content copied here | ||
|
||
error: value of type `M::R` does not have the `copy` ability | ||
┌─ tests/reference-safety/derefrence_reference.move:15:21 | ||
│ | ||
15 │ R{} = *&mut b.r; | ||
│ ^^^ reference content copied here |
22 changes: 11 additions & 11 deletions
22
...r-v2/tests/checking/typing/eq_invalid.exp → ...tests/ability-check/typing/eq_invalid.exp
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
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
third_party/move/move-compiler-v2/tests/ability-check/typing/eq_invalid2.exp
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,19 @@ | ||
|
||
Diagnostics: | ||
error: local `r` of type `M::R` does not have the `copy` ability | ||
┌─ tests/ability-check/typing/eq_invalid2.move:11:9 | ||
│ | ||
11 │ r == r; | ||
│ ^^^^^^ copy needed here because value is still in use | ||
|
||
error: local `r` of type `M::R` does not have the `drop` ability | ||
┌─ tests/ability-check/typing/eq_invalid2.move:11:9 | ||
│ | ||
11 │ r == r; | ||
│ ^^^^^^ operator drops value here (consider borrowing the argument) | ||
|
||
error: value of type `M::G1<T>` does not have the `drop` ability | ||
┌─ tests/ability-check/typing/eq_invalid2.move:15:9 | ||
│ | ||
15 │ G1{ f: t } == G1{ f: t }; | ||
│ ^^^^^^^^^^^^^^^^^^^^^^^^ operator drops value here (consider borrowing the argument) |
17 changes: 17 additions & 0 deletions
17
third_party/move/move-compiler-v2/tests/ability-check/typing/eq_invalid2.move
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,17 @@ | ||
module 0x8675309::M { | ||
struct S { u: u64 } | ||
struct R has key { | ||
f: u64 | ||
} | ||
struct G0<T> has drop { f: T } | ||
struct G1<T: key> { f: T } | ||
struct G2<phantom T> has drop {} | ||
|
||
fun t1(r: R) { | ||
r == r; | ||
} | ||
|
||
fun t3<T: copy + key>(t: T) { | ||
G1{ f: t } == G1{ f: t }; | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
third_party/move/move-compiler-v2/tests/ability-check/typing/exp_list_resource_drop.exp
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,2 @@ | ||
|
||
============ bytecode verification succeeded ======== |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...cking/typing/ignore_inferred_resource.exp → ...check/typing/ignore_inferred_resource.exp
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
Diagnostics: | ||
error: unable to infer instantiation of type `S<_>` (consider providing type arguments or annotating the type) | ||
┌─ tests/checking/typing/ignore_inferred_resource.move:4:9 | ||
┌─ tests/ability-check/typing/ignore_inferred_resource.move:4:9 | ||
│ | ||
4 │ S{}; | ||
│ ^^^ |
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
third_party/move/move-compiler-v2/tests/ability-check/typing/ignore_inferred_resource2.exp
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,7 @@ | ||
|
||
Diagnostics: | ||
error: unable to infer instantiation of type `S<_>` (consider providing type arguments or annotating the type) | ||
┌─ tests/ability-check/typing/ignore_inferred_resource2.move:4:9 | ||
│ | ||
4 │ S{}; | ||
│ ^^^ |
6 changes: 6 additions & 0 deletions
6
third_party/move/move-compiler-v2/tests/ability-check/typing/ignore_inferred_resource2.move
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,6 @@ | ||
module 0x8675309::M { | ||
struct S<phantom T> has drop {} | ||
fun no() { | ||
S{}; | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
third_party/move/move-compiler-v2/tests/ability-check/typing/ignore_inferred_resource3.exp
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,2 @@ | ||
|
||
============ bytecode verification succeeded ======== |
6 changes: 6 additions & 0 deletions
6
third_party/move/move-compiler-v2/tests/ability-check/typing/ignore_inferred_resource3.move
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,6 @@ | ||
module 0x8675309::M { | ||
struct S<phantom T> has drop {} | ||
fun no<T>() { | ||
S<T>{}; | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
third_party/move/move-compiler-v2/tests/ability-check/typing/ignore_inferred_resource4.exp
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,2 @@ | ||
|
||
============ bytecode verification succeeded ======== |
6 changes: 6 additions & 0 deletions
6
third_party/move/move-compiler-v2/tests/ability-check/typing/ignore_inferred_resource4.move
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,6 @@ | ||
module 0x8675309::M { | ||
struct S<phantom T> has drop {} | ||
fun no<T: drop>() { | ||
S<T>{}; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
.../move/move-compiler-v2/tests/ability-check/typing/module_call_explicit_type_arguments.exp
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,17 @@ | ||
|
||
Diagnostics: | ||
error: local `_x` of type `T` does not have the `drop` ability | ||
┌─ tests/ability-check/typing/module_call_explicit_type_arguments.move:2:33 | ||
│ | ||
2 │ fun foo<T, U>(_x: T, _y: U) { | ||
│ ╭─────────────────────────────────^ | ||
3 │ │ } | ||
│ ╰─────^ implicitly dropped here since it is no longer used | ||
|
||
error: local `_y` of type `U` does not have the `drop` ability | ||
┌─ tests/ability-check/typing/module_call_explicit_type_arguments.move:2:33 | ||
│ | ||
2 │ fun foo<T, U>(_x: T, _y: U) { | ||
│ ╭─────────────────────────────────^ | ||
3 │ │ } | ||
│ ╰─────^ implicitly dropped here since it is no longer used |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
third_party/move/move-compiler-v2/tests/ability-check/typing/mutate_resource.exp
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,19 @@ | ||
|
||
Diagnostics: | ||
error: local `r` of type `M::R` does not have the `drop` ability | ||
┌─ tests/ability-check/typing/mutate_resource.move:5:9 | ||
│ | ||
5 │ *r = R {}; | ||
│ ^^^^^^^^^ reference content dropped here | ||
|
||
error: local `r` of type `T` does not have the `drop` ability | ||
┌─ tests/ability-check/typing/mutate_resource.move:9:9 | ||
│ | ||
9 │ *r = x; | ||
│ ^^^^^^ reference content dropped here | ||
|
||
error: local `r` of type `T` does not have the `drop` ability | ||
┌─ tests/ability-check/typing/mutate_resource.move:13:9 | ||
│ | ||
13 │ *r = x; | ||
│ ^^^^^^ reference content dropped here |
File renamed without changes.
Oops, something went wrong.