]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
LoongArch: Add tests of -mstrict-align option.
authorXiaolong Chen <chenxiaolong@loongson.cn>
Mon, 11 Sep 2023 01:35:24 +0000 (09:35 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Thu, 14 Sep 2023 00:31:29 +0000 (08:31 +0800)
gcc/testsuite/ChangeLog:

* gcc.target/loongarch/strict-align.c: New test.

gcc/testsuite/gcc.target/loongarch/strict-align.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.target/loongarch/strict-align.c b/gcc/testsuite/gcc.target/loongarch/strict-align.c
new file mode 100644 (file)
index 0000000..040d849
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast -mstrict-align -mlasx" } */
+/* { dg-final { scan-assembler-not "vfadd.s" } } */
+
+void
+foo (float *restrict x, float *restrict y)
+{
+  x[0] = x[0] + y[0];
+  x[1] = x[1] + y[1];
+  x[2] = x[2] + y[2];
+  x[3] = x[3] + y[3];
+}