-
Notifications
You must be signed in to change notification settings - Fork 387
chore(mem2reg): add a few regression tests #9615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
443250d
46dccee
4fc34a4
7987c55
8f798b7
f1450bc
562f60a
7ea29df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| [package] | ||
| name = "regression_9398" | ||
| type = "bin" | ||
| authors = [""] | ||
| compiler_unstable_features = ["enums"] | ||
|
|
||
|
|
||
| [dependencies] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| fn main() { | ||
| let string = &mut "OOPS"; | ||
| let param = [string]; | ||
| assert_eq(*param[0], "OOPS"); | ||
| foo(param); | ||
| assert_eq(*param[0], "GOOD"); | ||
| } | ||
|
|
||
| fn foo(param: [&mut str<4>; 1]) { | ||
| let s = param[0]; | ||
| *s = "GOOD"; | ||
| for _ in 0..1 {} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| [package] | ||
| name = "regression_9415" | ||
| type = "bin" | ||
| authors = [""] | ||
| compiler_unstable_features = ["enums"] | ||
|
|
||
|
|
||
| [dependencies] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| index = 0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| unconstrained fn main(index: u32) { | ||
| let v0 = &mut 1; | ||
| let v1 = &mut 2; | ||
| let mut v3 = [v0]; | ||
| v3[index] = v1; | ||
| *v3[index] = 3; | ||
| assert_eq(*v3[index], 3); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| [package] | ||
| name = "regression_9439" | ||
| type = "bin" | ||
| authors = [""] | ||
| compiler_unstable_features = ["enums"] | ||
|
|
||
|
|
||
| [dependencies] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| n = 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| unconstrained fn main(n: u32) { | ||
| let num1 = &mut 0; | ||
| let mut slice = &[]; | ||
| for _ in 0..n { | ||
| slice = slice.push_back(num1); | ||
| } | ||
| *slice[0] = 9; | ||
| assert_eq(*slice[0], 9); | ||
| assert_eq(*num1, 9); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| [package] | ||
| name = "regression_9455" | ||
| type = "bin" | ||
| authors = [""] | ||
| compiler_unstable_features = ["enums"] | ||
|
|
||
|
|
||
| [dependencies] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| predicate = true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| unconstrained fn main(predicate: bool) { | ||
| let num1 = &mut 0; | ||
| let array = if predicate { [num1] } else { [num1] }; | ||
| *array[0] = 9; | ||
| assert_eq(*array[0], 9); | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.