diff options
author | John Hodge <tpg@mutabah.net> | 2019-11-24 21:37:58 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2019-11-24 21:37:58 +0800 |
commit | 916bfed2c597446c79831aaf29c83dd1e893e853 (patch) | |
tree | 3988723fd87aa525564f0f11c4a36035c258f62d /tools/mir_opt_test/tests/sroa.rs | |
parent | d600b873364d9a799b67ccd6054f4aa69ef3d1c0 (diff) | |
download | mrust-916bfed2c597446c79831aaf29c83dd1e893e853.tar.gz |
mir_opt_test - More basic test cases
Diffstat (limited to 'tools/mir_opt_test/tests/sroa.rs')
-rw-r--r-- | tools/mir_opt_test/tests/sroa.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/mir_opt_test/tests/sroa.rs b/tools/mir_opt_test/tests/sroa.rs new file mode 100644 index 00000000..30a69221 --- /dev/null +++ b/tools/mir_opt_test/tests/sroa.rs @@ -0,0 +1,20 @@ +// +// Tests for SROA-style optimisations +// - SROA = Scalar Reorganisation Of Aggregates - breaking composite types up into individual values +// + +#[test="simple_exp"] +fn simple(a: i32, b: i32) -> i32 +{ + let v: (i32, i32,); + bb0: { + ASSIGN v = (a, b); + ASSIGN retval = ADD(v.0, v.1); + } RETURN; +} +fn simple_exp(a: i32, b: i32) -> i32 +{ + bb0: { + ASSIGN retval = ADD(a, b); + } RETURN; +}
\ No newline at end of file |