aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_subreg_1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_subreg_1.c')
-rw-r--r--gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_subreg_1.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_subreg_1.c b/gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_subreg_1.c
new file mode 100644
index 00000000000..ac6ffdcf8de
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_subreg_1.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-ce1" } */
+
+/* Check that the inner if is transformed into CSELs. */
+
+int
+foo (int *x, int *z, int a)
+{
+ int b = 0;
+ int c = 0;
+ int d = 0;
+ int i;
+
+ for (i = 0; i < a; i++)
+ {
+ if (x[i] < c)
+ {
+ b = z[i];
+ if (c < b)
+ {
+ c = b;
+ d = i;
+ }
+ }
+ }
+
+ return c + d;
+}
+
+/* { dg-final { scan-rtl-dump "if-conversion succeeded through noce_convert_multiple_sets" "ce1" } } */