-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into vaivaswatha/ir_consts_2
- Loading branch information
Showing
15 changed files
with
139 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
13 changes: 13 additions & 0 deletions
13
test/src/e2e_vm_tests/test_programs/should_fail/unify_never/Forc.lock
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 @@ | ||
[[package]] | ||
name = "core" | ||
source = "path+from-root-DFCFC85C94C0C9BD" | ||
|
||
[[package]] | ||
name = "std" | ||
source = "path+from-root-DFCFC85C94C0C9BD" | ||
dependencies = ["core"] | ||
|
||
[[package]] | ||
name = "unify_never" | ||
source = "member" | ||
dependencies = ["std"] |
8 changes: 8 additions & 0 deletions
8
test/src/e2e_vm_tests/test_programs/should_fail/unify_never/Forc.toml
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,8 @@ | ||
[project] | ||
authors = ["Fuel Labs <[email protected]>"] | ||
license = "Apache-2.0" | ||
name = "unify_never" | ||
entry = "main.sw" | ||
|
||
[dependencies] | ||
std = { path = "../../../reduced_std_libs/sway-lib-std-assert" } |
22 changes: 22 additions & 0 deletions
22
test/src/e2e_vm_tests/test_programs/should_fail/unify_never/src/main.sw
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,22 @@ | ||
script; | ||
|
||
// Test of unification of the Never type | ||
|
||
impl [u32;0] { | ||
fn foo(self){ | ||
log("32"); | ||
} | ||
} | ||
|
||
impl [!;0] { | ||
fn foo(self){ | ||
log("never"); | ||
} | ||
} | ||
|
||
fn main() { | ||
let z:[u32;0] = []; | ||
|
||
// Should fail because z gets the type of its type ascription | ||
let y: [!;0] = z; | ||
} |
9 changes: 9 additions & 0 deletions
9
test/src/e2e_vm_tests/test_programs/should_fail/unify_never/test.toml
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 @@ | ||
category = "fail" | ||
|
||
#check: $()error | ||
#check: $()Mismatched types | ||
#nextln: $()expected: [!; 0] | ||
#nextln: $()found: [u32; 0]. | ||
#nextln: $()help: Variable declaration's type annotation does not match up with the assigned expression's type | ||
|
||
#check: $()Aborting due to 1 error |
8 changes: 8 additions & 0 deletions
8
test/src/e2e_vm_tests/test_programs/should_pass/ecall/ecall_basic/Forc.lock
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,8 @@ | ||
[[package]] | ||
name = "core" | ||
source = "path+from-root-02C557D3012ABF18" | ||
|
||
[[package]] | ||
name = "ecall_basic" | ||
source = "member" | ||
dependencies = ["core"] |
9 changes: 9 additions & 0 deletions
9
test/src/e2e_vm_tests/test_programs/should_pass/ecall/ecall_basic/Forc.toml
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 @@ | ||
[project] | ||
name = "ecall_basic" | ||
authors = ["Fuel Labs <[email protected]>"] | ||
entry = "main.sw" | ||
implicit-std = false | ||
license = "Apache-2.0" | ||
|
||
[dependencies] | ||
core = { path = "../../../../../../../sway-lib-core" } |
7 changes: 7 additions & 0 deletions
7
test/src/e2e_vm_tests/test_programs/should_pass/ecall/ecall_basic/src/main.sw
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 @@ | ||
script; | ||
|
||
fn main() { | ||
asm(r1: 1u64, r2: 2u32, r3: 3u32, r4: 4u32) { | ||
ecal r1 r2 r3 r4; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
test/src/e2e_vm_tests/test_programs/should_pass/ecall/ecall_basic/test.toml
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 @@ | ||
category = "unit_tests_pass" |
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
5 changes: 4 additions & 1 deletion
5
test/src/e2e_vm_tests/test_programs/should_pass/language/unify_never/test.toml
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,2 +1,5 @@ | ||
category = "compile" | ||
category = "run" | ||
expected_warnings = 1 | ||
expected_result = { action = "return", value = 32 } | ||
expected_result_new_encoding = { action = "return_data", value = "0000000000000020" } | ||
validate_abi = false |