-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor the verifier and add more mvir tests. (#1742)
- Loading branch information
1 parent
89e35df
commit 7a85750
Showing
26 changed files
with
309 additions
and
49 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...tests/tests/cases/mvir_tests/data_struct/data_struct_invalid_data_struct_without_copy.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-11: | ||
status ABORTED with code 10013 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
11 changes: 11 additions & 0 deletions
11
...ests/tests/cases/mvir_tests/data_struct/data_struct_invalid_data_struct_without_copy.mvir
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,11 @@ | ||
//# publish | ||
module 0x1.TestModule1 { | ||
// error code 10013: INVALID_DATA_STRUCT_WITHOUT_COPY_ABILITY | ||
struct S0 has drop {v: u64} | ||
|
||
metadata { | ||
data_struct { | ||
0x1::TestModule1::S0 -> true; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...tests/tests/cases/mvir_tests/data_struct/data_struct_invalid_data_struct_without_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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-11: | ||
status ABORTED with code 10012 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
11 changes: 11 additions & 0 deletions
11
...ests/tests/cases/mvir_tests/data_struct/data_struct_invalid_data_struct_without_drop.mvir
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,11 @@ | ||
//# publish | ||
module 0x1.TestModule1 { | ||
// error code 10012: INVALID_DATA_STRUCT_WITHOUT_DROP_ABILITY | ||
struct S0 has copy {v: u64} | ||
|
||
metadata { | ||
data_struct { | ||
0x1::TestModule1::S0 -> true; | ||
} | ||
} | ||
} |
File renamed without changes.
9 changes: 9 additions & 0 deletions
9
...-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_invalid_module_owner.mvir
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,9 @@ | ||
//# publish | ||
module 0x1.TestModule1 { | ||
metadata { | ||
data_struct { | ||
// error code 10010: INVALID_MODULE_OWNER | ||
0x123::SomeModule::Struct0 -> true; | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
...rooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_struct_not_exits.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-11: | ||
status ABORTED with code 10002 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
11 changes: 11 additions & 0 deletions
11
...ooch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_struct_not_exits.mvir
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,11 @@ | ||
//# publish | ||
module 0x1.TestModule1 { | ||
struct S0 has drop { x: u64 } | ||
|
||
metadata { | ||
data_struct { | ||
// error code 10002: STRUCT_NOT_EXISTS | ||
0x1::TestModule1::S1 -> true; | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
...k-tests/tests/cases/mvir_tests/private_generics/private_generics_invalid_module_owner.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-9: | ||
status ABORTED with code 10010 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
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.
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
...s/tests/cases/mvir_tests/private_generics/private_generics_not_allowed_primitive_type.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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-26: | ||
status ABORTED with code 10011 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
26 changes: 26 additions & 0 deletions
26
.../tests/cases/mvir_tests/private_generics/private_generics_not_allowed_primitive_type.mvir
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,26 @@ | ||
//# publish | ||
module 0x1.TestModule1 { | ||
metadata { | ||
private_generics { | ||
0x1::TestModule1::f1 -> [0, 1]; | ||
} | ||
} | ||
|
||
public f1<T1: copy+drop, T2: copy+drop>(arg1: T1, arg2: T1) { | ||
label b0: | ||
_ = move(arg1); | ||
_ = move(arg2); | ||
return; | ||
} | ||
|
||
public f2() { | ||
let a1: u32; | ||
let a2: u32; | ||
label b0: | ||
a1 = 123u32; | ||
a2 = 456u32; | ||
// error code 10011: INVALID_PRIVATE_GENERICS_TYPE | ||
Self.f1<u32, u32>(copy(a1), copy(a2)); | ||
return; | ||
} | ||
} |
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
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
...rk-tests/tests/cases/mvir_tests/private_generics/private_generics_too_many_parameters.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 @@ | ||
processed 2 tasks | ||
|
||
task 0 'publish'. lines 1-8: | ||
status EXECUTED | ||
|
||
task 1 'publish'. lines 10-36: | ||
status ABORTED with code 10004 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
36 changes: 36 additions & 0 deletions
36
...k-tests/tests/cases/mvir_tests/private_generics/private_generics_too_many_parameters.mvir
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,36 @@ | ||
//# publish | ||
module 0x1.TestModule0 { | ||
struct S0 has drop { x: u64 } | ||
public new(): Self.S0 { | ||
label b0: | ||
return S0{ x: 123 }; | ||
} | ||
} | ||
|
||
//# publish | ||
module 0x1.TestModule1 { | ||
import 0x1.TestModule0; | ||
metadata { | ||
private_generics { | ||
// error code 10004: TOO_MANY_PARAMETERS | ||
0x1::TestModule1::f1 -> [1, 1, 1, 1, 1, 1]; | ||
} | ||
} | ||
|
||
public f1<T1: drop, T2: drop>(arg1: T1, arg2: T2) { | ||
label b0: | ||
_ = move(arg1); | ||
_ = move(arg2); | ||
return; | ||
} | ||
|
||
public f2() { | ||
let s0: TestModule0.S0; | ||
let s1: TestModule0.S0; | ||
label b0: | ||
s0 = TestModule0.new(); | ||
s1 = TestModule0.new(); | ||
Self.f1<TestModule0.S0, TestModule0.S0>(move(s0), move(s1)); | ||
return; | ||
} | ||
} |
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
Oops, something went wrong.