summaryrefslogtreecommitdiff
path: root/tools/mir_opt_test/tests/sroa.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mir_opt_test/tests/sroa.rs')
-rw-r--r--tools/mir_opt_test/tests/sroa.rs20
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