aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/loongarch/mem-and-mask-opt.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/loongarch/mem-and-mask-opt.c')
-rw-r--r--gcc/testsuite/gcc.target/loongarch/mem-and-mask-opt.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/loongarch/mem-and-mask-opt.c b/gcc/testsuite/gcc.target/loongarch/mem-and-mask-opt.c
new file mode 100644
index 0000000..9b3a5cd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/mem-and-mask-opt.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* { dg-final { scan-assembler-not "bstrpick" } } */
+/* { dg-final { scan-assembler "ld\\.wu" } } */
+
+struct st
+{
+ char const *name;
+};
+struct fst
+{
+ struct st *groups;
+};
+
+struct fst *pfunc (int);
+
+const char *
+test (int pc, unsigned group)
+{
+ struct fst *pci = pfunc (pc);
+
+ return pci->groups[group].name;
+}