-
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.
Large integers in aggregates cannot be scalarised (#5442)
Fixes #5377
- Loading branch information
1 parent
f6d8710
commit 7109ca7
Showing
6 changed files
with
88 additions
and
1 deletion.
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
16 changes: 16 additions & 0 deletions
16
test/src/e2e_vm_tests/test_programs/should_pass/language/largeint_sroa/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,16 @@ | ||
[[package]] | ||
name = "core" | ||
source = "path+from-root-5C15EEA63C6F47D5" | ||
|
||
[[package]] | ||
name = "largeint_sroa" | ||
source = "member" | ||
dependencies = [ | ||
"core", | ||
"std", | ||
] | ||
|
||
[[package]] | ||
name = "std" | ||
source = "path+from-root-5C15EEA63C6F47D5" | ||
dependencies = ["core"] |
9 changes: 9 additions & 0 deletions
9
test/src/e2e_vm_tests/test_programs/should_pass/language/largeint_sroa/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] | ||
authors = ["Fuel Labs <[email protected]>"] | ||
entry = "main.sw" | ||
license = "Apache-2.0" | ||
name = "largeint_sroa" | ||
|
||
[dependencies] | ||
core = { path = "../../../../../../../sway-lib-core" } | ||
std = { path = "../../../../../../../sway-lib-std" } |
25 changes: 25 additions & 0 deletions
25
test/src/e2e_vm_tests/test_programs/should_pass/language/largeint_sroa/json_abi_oracle.json
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,25 @@ | ||
{ | ||
"configurables": [], | ||
"functions": [ | ||
{ | ||
"attributes": null, | ||
"inputs": [], | ||
"name": "main", | ||
"output": { | ||
"name": "", | ||
"type": 0, | ||
"typeArguments": null | ||
} | ||
} | ||
], | ||
"loggedTypes": [], | ||
"messagesTypes": [], | ||
"types": [ | ||
{ | ||
"components": null, | ||
"type": "bool", | ||
"typeId": 0, | ||
"typeParameters": null | ||
} | ||
] | ||
} |
35 changes: 35 additions & 0 deletions
35
test/src/e2e_vm_tests/test_programs/should_pass/language/largeint_sroa/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,35 @@ | ||
script; | ||
|
||
fn array_test() { | ||
let mut a = [0x0111111111111111111111111111111111111111111111111111111111111111u256]; | ||
assert(a[0] == 0x0111111111111111111111111111111111111111111111111111111111111111u256); | ||
a[0] = 0x0222222222222222222222222222222222222222222222222222222222222222u256; | ||
} | ||
|
||
struct S { | ||
x: u256, | ||
} | ||
|
||
fn struct_test() { | ||
let mut s = S { x: 0x0111111111111111111111111111111111111111111111111111111111111111u256 }; | ||
assert(s.x == 0x0111111111111111111111111111111111111111111111111111111111111111u256); | ||
s.x = 0x0222222222222222222222222222222222222222222222222222222222222222u256; | ||
} | ||
|
||
fn tuple_test() { | ||
let mut t = (0x0111111111111111111111111111111111111111111111111111111111111111u256,); | ||
assert(t.0 == 0x0111111111111111111111111111111111111111111111111111111111111111u256); | ||
t.0 = 0x0222222222222222222222222222222222222222222222222222222222222222u256; | ||
} | ||
|
||
fn main() { | ||
|
||
} | ||
|
||
|
||
#[test] | ||
fn test() { | ||
array_test(); | ||
struct_test(); | ||
tuple_test(); | ||
} |
2 changes: 2 additions & 0 deletions
2
test/src/e2e_vm_tests/test_programs/should_pass/language/largeint_sroa/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,2 @@ | ||
category = "unit_tests_pass" | ||
expected_warnings = 0 |