summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/microblaze
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.target/microblaze
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gcc.target/microblaze')
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/bshift.c53
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/div.c52
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/fcmp1.c10
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/fcmp2.c10
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/fcmp3.c10
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/fcvt.c21
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/float.c18
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/fsqrt.c10
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/mul-bshift-pcmp.c53
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/mul-bshift.c53
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/mul.c52
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/mulh-bshift-pcmp.c53
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/mulh.c53
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/nofcmp.c21
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/nofloat.c19
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/pcmp.c52
-rw-r--r--gcc/testsuite/gcc.target/microblaze/isa/vanilla.c89
-rw-r--r--gcc/testsuite/gcc.target/microblaze/microblaze.exp62
-rw-r--r--gcc/testsuite/gcc.target/microblaze/others/data_var1.c8
-rw-r--r--gcc/testsuite/gcc.target/microblaze/others/data_var2.c8
-rw-r--r--gcc/testsuite/gcc.target/microblaze/others/data_var3.c7
-rw-r--r--gcc/testsuite/gcc.target/microblaze/others/interrupt_handler_leaf.c10
-rw-r--r--gcc/testsuite/gcc.target/microblaze/others/sdata_var1.c15
-rw-r--r--gcc/testsuite/gcc.target/microblaze/others/sdata_var2.c10
-rw-r--r--gcc/testsuite/gcc.target/microblaze/others/sdata_var3.c13
-rw-r--r--gcc/testsuite/gcc.target/microblaze/others/sdata_var4.c15
-rw-r--r--gcc/testsuite/gcc.target/microblaze/others/sdata_var5.c15
-rw-r--r--gcc/testsuite/gcc.target/microblaze/others/sdata_var6.c18
-rw-r--r--gcc/testsuite/gcc.target/microblaze/others/string_cst1.c12
-rw-r--r--gcc/testsuite/gcc.target/microblaze/others/string_cst1_gpopt.c13
-rw-r--r--gcc/testsuite/gcc.target/microblaze/others/string_cst2.c13
-rw-r--r--gcc/testsuite/gcc.target/microblaze/others/string_cst2_gpopt.c15
-rw-r--r--gcc/testsuite/gcc.target/microblaze/others/strings1.c13
33 files changed, 876 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/bshift.c b/gcc/testsuite/gcc.target/microblaze/isa/bshift.c
new file mode 100644
index 000000000..64cf1e2e5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/bshift.c
@@ -0,0 +1,53 @@
+/* { dg-options "-O3 -mcpu=v6.00.a -mxl-barrel-shift" } */
+
+volatile int m1, m2, m3;
+volatile unsigned int u1, u2, u3;
+volatile long l1, l2;
+volatile long long llp;
+
+volatile unsigned long ul1, ul2;
+volatile unsigned long long ullp;
+
+int test_mul () {
+
+ /* { dg-final { scan-assembler-not "mul\tr" } } */
+ m1 = m2 * m3 ;
+
+ /* { dg-final { scan-assembler-not "muli" } } */
+ m3 = m1 * 1234 ;
+
+ /* { dg-final { scan-assembler-not "mulh" } } */
+ llp = ((long long)l1 * l2);
+
+ /* { dg-final { scan-assembler-not "mulhu" } } */
+ ullp = ((unsigned long long)ul1 * ul2);
+
+ /* { dg-final { scan-assembler-not "mulhsu" } } */
+ llp = ((long long)l1 * ul2);
+
+ /* { dg-final { scan-assembler "bslli\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),25" } } */
+ m3 = m2 << 25;
+
+ /* { dg-final { scan-assembler "bsll\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ m2 = m1 << m3;
+
+ /* { dg-final { scan-assembler "bsrai\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),25" } } */
+ m3 = m2 >> 25;
+
+ /* { dg-final { scan-assembler "bsra\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ m2 = m1 >> m3;
+
+ /* { dg-final { scan-assembler-not "idiv" } } */
+ m1 = m2 / m1;
+
+ /* { dg-final { scan-assembler-not "idivu" } } */
+ u1 = u2 / u3;
+
+ /* { dg-final { scan-assembler-not "pcmpne" } } */
+ m3 = (m3 != m1);
+
+ /* { dg-final { scan-assembler-not "pcmpeq" } } */
+ return (m1 == m2);
+
+}
+
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/div.c b/gcc/testsuite/gcc.target/microblaze/isa/div.c
new file mode 100644
index 000000000..25ee42ce5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/div.c
@@ -0,0 +1,52 @@
+/* { dg-options "-O3 -mcpu=v6.00.a -mno-xl-soft-div" } */
+
+volatile int m1, m2, m3;
+volatile long l1, l2;
+volatile long long llp;
+volatile unsigned int u1, u2, u3;
+
+volatile unsigned long ul1, ul2;
+volatile unsigned long long ullp;
+
+int test_mul () {
+
+ /* { dg-final { scan-assembler-not "mul\tr" } } */
+ m1 = m2 * m3 ;
+
+ /* { dg-final { scan-assembler-not "muli" } } */
+ m3 = m1 * 1234 ;
+
+ /* { dg-final { scan-assembler-not "mulh" } } */
+ llp = ((long long)l1 * l2);
+
+ /* { dg-final { scan-assembler-not "mulhu" } } */
+ ullp = ((unsigned long long)ul1 * ul2);
+
+ /* { dg-final { scan-assembler-not "mulhsu" } } */
+ llp = ((long long)l1 * ul2);
+
+ /* { dg-final { scan-assembler-not "bslli" } } */
+ m3 = m2 << 25;
+
+ /* { dg-final { scan-assembler-not "bsll" } } */
+ m2 = m1 << m3;
+
+ /* { dg-final { scan-assembler-not "bsrai" } } */
+ m3 = m2 >> 25;
+
+ /* { dg-final { scan-assembler-not "bsra" } } */
+ m2 = m1 >> m3;
+
+ /* { dg-final { scan-assembler "idiv" } } */
+ m1 = m2 / m1;
+
+ /* { dg-final { scan-assembler "idivu" } } */
+ u1 = u2 / u3;
+
+ /* { dg-final { scan-assembler-not "pcmpne" } } */
+ m3 = (m3 != m1);
+
+ /* { dg-final { scan-assembler-not "pcmpeq" } } */
+ return (m1 == m2);
+}
+
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/fcmp1.c b/gcc/testsuite/gcc.target/microblaze/isa/fcmp1.c
new file mode 100644
index 000000000..4041a2413
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/fcmp1.c
@@ -0,0 +1,10 @@
+/* { dg-options "-O3 -mcpu=v6.00.a -mhard-float" } */
+
+volatile float f1, f2, f3;
+
+void float_func ()
+{
+ /* { dg-final { scan-assembler "fcmp\.(le|gt)\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ if (f2 <= f3)
+ print ("le");
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/fcmp2.c b/gcc/testsuite/gcc.target/microblaze/isa/fcmp2.c
new file mode 100644
index 000000000..3902b839d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/fcmp2.c
@@ -0,0 +1,10 @@
+/* { dg-options "-O3 -mcpu=v6.00.a -mhard-float" } */
+
+volatile float f1, f2, f3;
+
+void float_func ()
+{
+ /* { dg-final { scan-assembler "fcmp\.(lt|ge)\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ if (f2 < f3)
+ print ("lt");
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/fcmp3.c b/gcc/testsuite/gcc.target/microblaze/isa/fcmp3.c
new file mode 100644
index 000000000..8555974dd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/fcmp3.c
@@ -0,0 +1,10 @@
+/* { dg-options "-O3 -mcpu=v6.00.a -mhard-float" } */
+
+volatile float f1, f2, f3;
+
+void float_func ()
+{
+ /* { dg-final { scan-assembler "fcmp\.(eq|ne)\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ if (f2 == f3)
+ print ("eq");
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/fcvt.c b/gcc/testsuite/gcc.target/microblaze/isa/fcvt.c
new file mode 100644
index 000000000..ee057c1b6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/fcvt.c
@@ -0,0 +1,21 @@
+/* { dg-options "-O3 -mcpu=v6.00.a -mhard-float -mxl-float-convert" } */
+
+int float_func (float f)
+{
+ /* { dg-final { scan-assembler "flt\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ return f;
+}
+
+
+float int_func (int i)
+{
+ /* { dg-final { scan-assembler "fint\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ return i;
+}
+
+
+float uint_func (unsigned int i)
+{
+ /* { dg-final { scan-assembler "fint\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ return i;
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/float.c b/gcc/testsuite/gcc.target/microblaze/isa/float.c
new file mode 100644
index 000000000..f5ef3186c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/float.c
@@ -0,0 +1,18 @@
+/* { dg-options "-O3 -mcpu=v6.00.a -mhard-float" } */
+
+volatile float f1, f2, f3;
+
+void float_func ()
+{
+ /* { dg-final { scan-assembler "fmul\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ f1 = f2 * f3;
+
+ /* { dg-final { scan-assembler "fadd\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ f1 = f2 + f3;
+
+ /* { dg-final { scan-assembler "frsub\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ f1 = f2 - f3;
+
+ /* { dg-final { scan-assembler "fdiv\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ f1 = f2 / f3;
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/fsqrt.c b/gcc/testsuite/gcc.target/microblaze/isa/fsqrt.c
new file mode 100644
index 000000000..4c2466e4a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/fsqrt.c
@@ -0,0 +1,10 @@
+/* { dg-options "-O3 -mcpu=v6.00.a -mhard-float -mxl-float-sqrt" } */
+#include <math.h>
+
+float sqrt_func (float f)
+{
+ /* { dg-final { scan-assembler "fsqrt\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ return sqrtf (f);
+}
+
+
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/mul-bshift-pcmp.c b/gcc/testsuite/gcc.target/microblaze/isa/mul-bshift-pcmp.c
new file mode 100644
index 000000000..ce186314e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/mul-bshift-pcmp.c
@@ -0,0 +1,53 @@
+/* { dg-options "-O3 -mcpu=v6.00.a -mxl-barrel-shift -mno-xl-soft-mul -mxl-pattern-compare" } */
+
+volatile int m1, m2, m3;
+volatile unsigned int u1, u2, u3;
+volatile long l1, l2;
+volatile long long llp;
+
+volatile unsigned long ul1, ul2;
+volatile unsigned long long ullp;
+
+int test_mul () {
+
+ /* { dg-final { scan-assembler "mul\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ m1 = m2 * m3 ;
+
+ /* { dg-final { scan-assembler "muli\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),(0x\[0-9a-fA-F]+|\[+-]*\[0-9]+)" } } */
+ m3 = m1 * 1234 ;
+
+ /* { dg-final { scan-assembler-not "mulh" } } */
+ llp = ((long long)l1 * l2);
+
+ /* { dg-final { scan-assembler-not "mulhu" } } */
+ ullp = ((unsigned long long)ul1 * ul2);
+
+ /* { dg-final { scan-assembler-not "mulhsu" } } */
+ llp = ((long long)l1 * ul2);
+
+ /* { dg-final { scan-assembler "bslli\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),25" } } */
+ m3 = m2 << 25;
+
+ /* { dg-final { scan-assembler "bsll\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ m2 = m1 << m3;
+
+ /* { dg-final { scan-assembler "bsrai\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),25" } } */
+ m3 = m2 >> 25;
+
+ /* { dg-final { scan-assembler "bsra\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ m2 = m1 >> m3;
+
+ /* { dg-final { scan-assembler-not "idiv" } } */
+ m1 = m2 / m1;
+
+ /* { dg-final { scan-assembler-not "idivu" } } */
+ u1 = u2 / u3;
+
+ /* { dg-final { scan-assembler "pcmpne\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ m3 = (m3 != m1);
+
+ /* { dg-final { scan-assembler "pcmpeq\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ return (m1 == m2);
+
+}
+
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/mul-bshift.c b/gcc/testsuite/gcc.target/microblaze/isa/mul-bshift.c
new file mode 100644
index 000000000..76d174ec7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/mul-bshift.c
@@ -0,0 +1,53 @@
+/* { dg-options "-O3 -mcpu=v6.00.a -mxl-barrel-shift -mno-xl-soft-mul" } */
+
+volatile int m1, m2, m3;
+volatile unsigned int u1, u2, u3;
+volatile long l1, l2;
+volatile long long llp;
+
+volatile unsigned long ul1, ul2;
+volatile unsigned long long ullp;
+
+int test_mul () {
+
+ /* { dg-final { scan-assembler "mul\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ m1 = m2 * m3 ;
+
+ /* { dg-final { scan-assembler "muli\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),(0x\[0-9a-fA-F]+|\[+-]*\[0-9]+)" } } */
+ m3 = m1 * 1234 ;
+
+ /* { dg-final { scan-assembler-not "mulh" } } */
+ llp = ((long long)l1 * l2);
+
+ /* { dg-final { scan-assembler-not "mulhu" } } */
+ ullp = ((unsigned long long)ul1 * ul2);
+
+ /* { dg-final { scan-assembler-not "mulhsu" } } */
+ llp = ((long long)l1 * ul2);
+
+ /* { dg-final { scan-assembler "bslli\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),25" } } */
+ m3 = m2 << 25;
+
+ /* { dg-final { scan-assembler "bsll\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ m2 = m1 << m3;
+
+ /* { dg-final { scan-assembler "bsrai\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),25" } } */
+ m3 = m2 >> 25;
+
+ /* { dg-final { scan-assembler "bsra\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ m2 = m1 >> m3;
+
+ /* { dg-final { scan-assembler-not "idiv" } } */
+ m1 = m2 / m1;
+
+ /* { dg-final { scan-assembler-not "idivu" } } */
+ u1 = u2 / u3;
+
+ /* { dg-final { scan-assembler-not "pcmpne" } } */
+ m3 = (m3 != m1);
+
+ /* { dg-final { scan-assembler-not "pcmpeq" } } */
+ return (m1 == m2);
+
+}
+
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/mul.c b/gcc/testsuite/gcc.target/microblaze/isa/mul.c
new file mode 100644
index 000000000..d2a6bec61
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/mul.c
@@ -0,0 +1,52 @@
+/* { dg-options "-O3 -mcpu=v6.00.a -mno-xl-soft-mul" } */
+
+volatile int m1, m2, m3;
+volatile long l1, l2;
+volatile long long llp;
+volatile unsigned int u1, u2, u3;
+
+volatile unsigned long ul1, ul2;
+volatile unsigned long long ullp;
+
+int test_mul () {
+
+ /* { dg-final { scan-assembler "mul\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ m1 = m2 * m3 ;
+
+ /* { dg-final { scan-assembler "muli\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),(0x\[0-9a-fA-F]+|\[+-]*\[0-9]+)" } } */
+ m3 = m1 * 1234 ;
+
+ /* { dg-final { scan-assembler-not "mulh" } } */
+ llp = ((long long)l1 * l2);
+
+ /* { dg-final { scan-assembler-not "mulhu" } } */
+ ullp = ((unsigned long long)ul1 * ul2);
+
+ /* { dg-final { scan-assembler-not "mulhsu" } } */
+ llp = ((long long)l1 * ul2);
+
+ /* { dg-final { scan-assembler-not "bslli" } } */
+ m3 = m2 << 25;
+
+ /* { dg-final { scan-assembler-not "bsll" } } */
+ m2 = m1 << m3;
+
+ /* { dg-final { scan-assembler-not "bsrai" } } */
+ m3 = m2 >> 25;
+
+ /* { dg-final { scan-assembler-not "bsra" } } */
+ m2 = m1 >> m3;
+
+ /* { dg-final { scan-assembler-not "idiv" } } */
+ m1 = m2 / m1;
+
+ /* { dg-final { scan-assembler-not "idivu" } } */
+ u1 = u2 / u3;
+
+ /* { dg-final { scan-assembler-not "pcmpne" } } */
+ m3 = (m3 != m1);
+
+ /* { dg-final { scan-assembler-not "pcmpeq" } } */
+ return (m1 == m2);
+}
+
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/mulh-bshift-pcmp.c b/gcc/testsuite/gcc.target/microblaze/isa/mulh-bshift-pcmp.c
new file mode 100644
index 000000000..a15983af1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/mulh-bshift-pcmp.c
@@ -0,0 +1,53 @@
+/* { dg-options "-O3 -mcpu=v6.00.a -mxl-barrel-shift -mno-xl-soft-mul -mxl-pattern-compare -mxl-multiply-high" } */
+
+volatile int m1, m2, m3;
+volatile unsigned int u1, u2, u3;
+volatile long l1, l2;
+volatile long long llp;
+
+volatile unsigned long ul1, ul2;
+volatile unsigned long long ullp;
+
+int test_mul () {
+
+ /* { dg-final { scan-assembler "mul\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ m1 = m2 * m3 ;
+
+ /* { dg-final { scan-assembler "muli\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),(0x\[0-9a-fA-F]+|\[+-]*\[0-9]+)" } } */
+ m3 = m1 * 1234 ;
+
+ /* { dg-final { scan-assembler "mulh\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ llp = (long long)l1 * l2;
+
+ /* { dg-final { scan-assembler "mulhu\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ ullp = (unsigned long long)ul1 * ul2;
+
+ /* { dg-final { scan-assembler "mulhsu\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ llp = (long long)l1 * ul2;
+
+ /* { dg-final { scan-assembler "bslli\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),25" } } */
+ m3 = m2 << 25;
+
+ /* { dg-final { scan-assembler "bsll\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ m2 = m1 << m3;
+
+ /* { dg-final { scan-assembler "bsrai\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),25" } } */
+ m3 = m2 >> 25;
+
+ /* { dg-final { scan-assembler "bsra\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ m2 = m1 >> m3;
+
+ /* { dg-final { scan-assembler-not "idiv" } } */
+ m1 = m2 / m1;
+
+ /* { dg-final { scan-assembler-not "idivu" } } */
+ u1 = u2 / u3;
+
+ /* { dg-final { scan-assembler "pcmpne\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ m3 = (m3 != m1);
+
+ /* { dg-final { scan-assembler "pcmpeq\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ return (m1 == m2);
+
+}
+
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/mulh.c b/gcc/testsuite/gcc.target/microblaze/isa/mulh.c
new file mode 100644
index 000000000..6e0cc3ac4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/mulh.c
@@ -0,0 +1,53 @@
+/* { dg-options "-O3 -mcpu=v6.00.a -mno-xl-soft-mul -mxl-multiply-high" } */
+
+volatile int m1, m2, m3;
+volatile unsigned int u1, u2, u3;
+volatile long l1, l2;
+volatile long long llp;
+
+volatile unsigned long ul1, ul2;
+volatile unsigned long long ullp;
+
+int test_mul () {
+
+ /* { dg-final { scan-assembler "mul\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ m1 = m2 * m3 ;
+
+ /* { dg-final { scan-assembler "muli\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),(0x\[0-9a-fA-F]+|\[+-]*\[0-9]+)" } } */
+ m3 = m1 * 1234 ;
+
+ /* { dg-final { scan-assembler "mulh\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ llp = ((long long)l1 * l2);
+
+ /* { dg-final { scan-assembler "mulhu\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ ullp = ((unsigned long long)ul1 * ul2);
+
+ /* { dg-final { scan-assembler "mulhsu\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
+ llp = ((long long)l1 * ul2);
+
+ /* { dg-final { scan-assembler-not "bslli" } } */
+ m3 = m2 << 25;
+
+ /* { dg-final { scan-assembler-not "bsll" } } */
+ m2 = m1 << m3;
+
+ /* { dg-final { scan-assembler-not "bsrai" } } */
+ m3 = m2 >> 25;
+
+ /* { dg-final { scan-assembler-not "bsra" } } */
+ m2 = m1 >> m3;
+
+ /* { dg-final { scan-assembler-not "idiv" } } */
+ m1 = m2 / m1;
+
+ /* { dg-final { scan-assembler-not "idivu" } } */
+ u1 = u2 / u3;
+
+ /* { dg-final { scan-assembler-not "pcmpne" } } */
+ m3 = (m3 != m1);
+
+ /* { dg-final { scan-assembler-not "pcmpeq" } } */
+ return (m1 == m2);
+
+}
+
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/nofcmp.c b/gcc/testsuite/gcc.target/microblaze/isa/nofcmp.c
new file mode 100644
index 000000000..ebfb170ec
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/nofcmp.c
@@ -0,0 +1,21 @@
+/* { dg-options "-O3 -mcpu=v6.00.a " } */
+
+volatile float f1, f2, f3;
+
+void float_func ()
+{
+ /* { dg-final { scan-assembler-not "fcmp" } } */
+ if (f2 <= f3)
+ print ("le");
+ else if (f2 == f3)
+ print ("eq");
+ else if (f2 < f3)
+ print ("lt");
+ else if (f2 > f3)
+ print ("gt");
+ else if (f2 >= f3)
+ print ("ge");
+ else if (f2 != f3)
+ print ("ne");
+
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/nofloat.c b/gcc/testsuite/gcc.target/microblaze/isa/nofloat.c
new file mode 100644
index 000000000..647da3cfe
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/nofloat.c
@@ -0,0 +1,19 @@
+/* { dg-options "-O3 -mcpu=v6.00.a -msoft-float" } */
+
+volatile float f1, f2, f3;
+
+void float_func ()
+{
+ /* { dg-final { scan-assembler-not "fmul" } } */
+ f1 = f2 * f3;
+
+ /* { dg-final { scan-assembler-not "fadd" } } */
+ f1 = f2 + f3;
+
+ /* { dg-final { scan-assembler-not "frsub" } } */
+ f1 = f2 - f3;
+
+ /* { dg-final { scan-assembler-not "fdiv" } } */
+ f1 = f2 / f3;
+
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/pcmp.c b/gcc/testsuite/gcc.target/microblaze/isa/pcmp.c
new file mode 100644
index 000000000..aea795721
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/pcmp.c
@@ -0,0 +1,52 @@
+/* { dg-options "-O3 -mcpu=v6.00.a -mxl-pattern-compare" } */
+
+volatile int m1, m2, m3;
+volatile long l1, l2;
+volatile long long llp;
+volatile unsigned int u1, u2, u3;
+
+volatile unsigned long ul1, ul2;
+volatile unsigned long long ullp;
+
+int test_mul () {
+
+ /* { dg-final { scan-assembler-not "mul\tr" } } */
+ m1 = m2 * m3 ;
+
+ /* { dg-final { scan-assembler-not "muli" } } */
+ m3 = m1 * 1234 ;
+
+ /* { dg-final { scan-assembler-not "mulh" } } */
+ llp = ((long long)l1 * l2);
+
+ /* { dg-final { scan-assembler-not "mulhu" } } */
+ ullp = ((unsigned long long)ul1 * ul2);
+
+ /* { dg-final { scan-assembler-not "mulhsu" } } */
+ llp = ((long long)l1 * ul2);
+
+ /* { dg-final { scan-assembler-not "bslli" } } */
+ m3 = m2 << 25;
+
+ /* { dg-final { scan-assembler-not "bsll" } } */
+ m2 = m1 << m3;
+
+ /* { dg-final { scan-assembler-not "bsrai" } } */
+ m3 = m2 >> 25;
+
+ /* { dg-final { scan-assembler-not "bsra" } } */
+ m2 = m1 >> m3;
+
+ /* { dg-final { scan-assembler-not "idiv" } } */
+ m1 = m2 / m1;
+
+ /* { dg-final { scan-assembler-not "idivu" } } */
+ u1 = u2 / u3;
+
+ /* { dg-final { scan-assembler "pcmpne" } } */
+ m3 = (m3 != m1);
+
+ /* { dg-final { scan-assembler "pcmpeq" } } */
+ return (m1 == m2);
+}
+
diff --git a/gcc/testsuite/gcc.target/microblaze/isa/vanilla.c b/gcc/testsuite/gcc.target/microblaze/isa/vanilla.c
new file mode 100644
index 000000000..1d6ba807b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/isa/vanilla.c
@@ -0,0 +1,89 @@
+/* { dg-options "-O3 -mcpu=v6.00.a -mcpu=v6.00.a" } */
+
+volatile int m1, m2, m3;
+volatile long l1, l2;
+volatile long long llp;
+volatile unsigned int u1, u2, u3;
+
+volatile unsigned long ul1, ul2;
+volatile unsigned long long ullp;
+
+int test_mul () {
+
+ /* { dg-final { scan-assembler-not "mul\tr" } } */
+ m1 = m2 * m3 ;
+
+ /* { dg-final { scan-assembler-not "muli" } } */
+ m3 = m1 * 1234 ;
+
+ /* { dg-final { scan-assembler-not "mulh" } } */
+ llp = ((long long)l1 * l2);
+
+ /* { dg-final { scan-assembler-not "mulhu" } } */
+ ullp = ((unsigned long long)ul1 * ul2);
+
+ /* { dg-final { scan-assembler-not "mulhsu" } } */
+ llp = ((long long)l1 * ul2);
+
+ /* { dg-final { scan-assembler-not "bslli" } } */
+ m3 = m2 << 25;
+
+ /* { dg-final { scan-assembler-not "bsll" } } */
+ m2 = m1 << m3;
+
+ /* { dg-final { scan-assembler-not "bsrai" } } */
+ m3 = m2 >> 25;
+
+ /* { dg-final { scan-assembler-not "bsra" } } */
+ m2 = m1 >> m3;
+
+ /* { dg-final { scan-assembler-not "idiv" } } */
+ m1 = m2 / m1;
+
+ /* { dg-final { scan-assembler-not "idivu" } } */
+ u1 = u2 / u3;
+
+ /* { dg-final { scan-assembler-not "pcmpne" } } */
+ m3 = (m3 != m1);
+
+ /* { dg-final { scan-assembler-not "pcmpeq" } } */
+ return (m1 == m2);
+}
+
+
+
+volatile float f1, f2, f3;
+
+void float_func ()
+{
+ /* { dg-final { scan-assembler-not "fmul" } } */
+ f1 = f2 * f3;
+
+ /* { dg-final { scan-assembler-not "fadd" } } */
+ f1 = f2 + f3;
+
+ /* { dg-final { scan-assembler-not "frsub" } } */
+ f1 = f2 - f3;
+
+ /* { dg-final { scan-assembler-not "fdiv" } } */
+ f1 = f2 / f3;
+
+}
+
+void float_cmp_func ()
+{
+ /* { dg-final { scan-assembler-not "fcmp" } } */
+ if (f2 <= f3)
+ print ("le");
+ else if (f2 == f3)
+ print ("eq");
+ else if (f2 < f3)
+ print ("lt");
+ else if (f2 > f3)
+ print ("gt");
+ else if (f2 >= f3)
+ print ("ge");
+ else if (f2 != f3)
+ print ("ne");
+
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/microblaze.exp b/gcc/testsuite/gcc.target/microblaze/microblaze.exp
new file mode 100644
index 000000000..a8994e91f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/microblaze.exp
@@ -0,0 +1,62 @@
+# Copyright 2009, 2010 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+
+# MicroBlaze test driver that uses the `dg.exp' driver.
+
+# Exit immediately if this isn't a MicroBlaze target.
+if { ![istarget microblaze*-*-*] } then {
+ return
+}
+
+# Don't execute when we are testing some configuration of GCC or G++.
+# This we figure out by looking at target_config_cflags which needs to be "" for microblaze.exp
+if { $target_config_cflags != "" } {
+ return
+}
+
+global TORTURE_OPTIONS
+set TORTURE_OPTIONS [list \
+ { -O0 } \
+ { -O1 } \
+ { -O2 } \
+ { -O3 } \
+ { -Os } ]
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# Initialize `dg'.
+dg-init
+
+set default_c_flags ""
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/isa/*.\[cSi\]]] \
+${default_c_flags} ""
+
+gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/others/*.\[cSi\]]] \
+ "-mcpu=v6.00.a"
+
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.target/microblaze/others/data_var1.c b/gcc/testsuite/gcc.target/microblaze/others/data_var1.c
new file mode 100644
index 000000000..15b85ca77
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/others/data_var1.c
@@ -0,0 +1,8 @@
+/* { dg-final { scan-assembler "\.bss*" } } */
+int global;
+
+int testfunc ()
+{
+/* { dg-final { scan-assembler "\lwi\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r0" } } */
+ return global;
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/others/data_var2.c b/gcc/testsuite/gcc.target/microblaze/others/data_var2.c
new file mode 100644
index 000000000..9fb7347ba
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/others/data_var2.c
@@ -0,0 +1,8 @@
+/* { dg-final { scan-assembler "\.data*" } } */
+int global = 10;
+
+int testfunc ()
+{
+/* { dg-final { scan-assembler "\lwi\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r0" } } */
+ return global;
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/others/data_var3.c b/gcc/testsuite/gcc.target/microblaze/others/data_var3.c
new file mode 100644
index 000000000..2b3f06410
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/others/data_var3.c
@@ -0,0 +1,7 @@
+/* { dg-final { scan-assembler "\.rodata*" } } */
+const int global = 10;
+
+int testfunc ()
+{
+ return global;
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/others/interrupt_handler_leaf.c b/gcc/testsuite/gcc.target/microblaze/others/interrupt_handler_leaf.c
new file mode 100644
index 000000000..9d068d05e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/others/interrupt_handler_leaf.c
@@ -0,0 +1,10 @@
+int leaf_func () __attribute__ ((interrupt_handler));
+volatile int intr_occurred;
+
+int leaf_func ()
+{
+
+ /* { dg-final { scan-assembler "rtid\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),0" } } */
+ /* { dg-final { scan-assembler-not "rtsd" } } */
+ intr_occurred += 1;
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/others/sdata_var1.c b/gcc/testsuite/gcc.target/microblaze/others/sdata_var1.c
new file mode 100644
index 000000000..2337f5a1e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/others/sdata_var1.c
@@ -0,0 +1,15 @@
+/* { dg-options "-mxl-gp-opt" } */
+
+/* { dg-final { scan-assembler "\.sbss\[^2]+" } } */
+typedef int Boolean;
+volatile Boolean global = 0;
+int testfunc ()
+{
+/* { dg-final { scan-assembler "\lwi\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r13" } } */
+ return global;
+}
+
+int main ()
+{
+
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/others/sdata_var2.c b/gcc/testsuite/gcc.target/microblaze/others/sdata_var2.c
new file mode 100644
index 000000000..1c91d0043
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/others/sdata_var2.c
@@ -0,0 +1,10 @@
+/* { dg-options "-mxl-gp-opt" } */
+
+/* { dg-final { scan-assembler "\.sdata\[^2]+" } } */
+int global = 10;
+
+int testfunc ()
+{
+/* { dg-final { scan-assembler "\lwi\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r13" } } */
+ return global;
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/others/sdata_var3.c b/gcc/testsuite/gcc.target/microblaze/others/sdata_var3.c
new file mode 100644
index 000000000..07c80041c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/others/sdata_var3.c
@@ -0,0 +1,13 @@
+/* { dg-options "-mxl-gp-opt" } */
+
+extern int a;
+
+/* { dg-final { scan-assembler "\.sdata2" } } */
+const int global1 = 10;
+extern const int global2;
+
+int testfunc ()
+{
+/* { dg-final { scan-assembler "\lwi\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r2" } } */
+ return global2 + global1;
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/others/sdata_var4.c b/gcc/testsuite/gcc.target/microblaze/others/sdata_var4.c
new file mode 100644
index 000000000..4dfa337d5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/others/sdata_var4.c
@@ -0,0 +1,15 @@
+/* { dg-options "-mxl-gp-opt -G 16" } */
+
+/* { dg-final { scan-assembler "\.sbss\[^2]+" } } */
+struct test_s {
+ int a;
+ int b;
+ int c;
+ int d;
+} global;
+
+int testfunc ()
+{
+/* { dg-final { scan-assembler "\lwi\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r13" } } */
+ return global.a;
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/others/sdata_var5.c b/gcc/testsuite/gcc.target/microblaze/others/sdata_var5.c
new file mode 100644
index 000000000..5c61962bf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/others/sdata_var5.c
@@ -0,0 +1,15 @@
+/* { dg-options "-mxl-gp-opt -G 16" } */
+
+/* { dg-final { scan-assembler "\.sdata\[^2]+" } } */
+struct test_s {
+ int a;
+ int b;
+ int c;
+ int d;
+} global = { 1, 2, 3, 4 };
+
+int testfunc ()
+{
+/* { dg-final { scan-assembler "\lwi\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r13" } } */
+ return global.a;
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/others/sdata_var6.c b/gcc/testsuite/gcc.target/microblaze/others/sdata_var6.c
new file mode 100644
index 000000000..0c8fe431f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/others/sdata_var6.c
@@ -0,0 +1,18 @@
+/* { dg-options "-mxl-gp-opt -G 16" } */
+
+struct test_s {
+ int a;
+ int b;
+ int c;
+ int d;
+};
+
+/* { dg-final { scan-assembler "\.sdata2" } } */
+const struct test_s global1 = { 1, 2, 3, 4};
+extern const struct test_s global2;
+
+int testfunc ()
+{
+/* { dg-final { scan-assembler "\lwi\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r2" } } */
+ return global2.a + global1.a;
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/others/string_cst1.c b/gcc/testsuite/gcc.target/microblaze/others/string_cst1.c
new file mode 100644
index 000000000..2a74f4ce7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/others/string_cst1.c
@@ -0,0 +1,12 @@
+#include <string.h>
+
+/* { dg-final { scan-assembler "\.rodata*" } } */
+/* { dg-final { scan-assembler "\.data*" } } */
+
+char *string1 = "string1";
+
+int testfunc (char *cptr)
+{
+/* { dg-final { scan-assembler-not "\lwi\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r13" } } */
+ strcpy (string1, cptr);
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/others/string_cst1_gpopt.c b/gcc/testsuite/gcc.target/microblaze/others/string_cst1_gpopt.c
new file mode 100644
index 000000000..5b5d3db18
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/others/string_cst1_gpopt.c
@@ -0,0 +1,13 @@
+/* { dg-options "-mxl-gp-opt" } */
+
+#include <string.h>
+
+/* { dg-final { scan-assembler "\.rodata*" } } */
+/* { dg-final { scan-assembler "\.sdata\[^2]+" } } */
+char *string1 = "string1";
+
+int testfunc (char *cptr)
+{
+/* { dg-final { scan-assembler "\lwi\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r13" } } */
+ strcpy (string1, cptr);
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/others/string_cst2.c b/gcc/testsuite/gcc.target/microblaze/others/string_cst2.c
new file mode 100644
index 000000000..c375339dc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/others/string_cst2.c
@@ -0,0 +1,13 @@
+#include <string.h>
+
+/* { dg-final { scan-assembler "\.rodata*" } } */
+/* { dg-final { scan-assembler "\.data*" } } */
+const char *string1 = "string1";
+
+char* testfunc (char *cptr)
+{
+/* { dg-final { scan-assembler-not "\lwi\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r13" } } */
+ strcpy (cptr, string1);
+
+ return cptr;
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/others/string_cst2_gpopt.c b/gcc/testsuite/gcc.target/microblaze/others/string_cst2_gpopt.c
new file mode 100644
index 000000000..057e8c447
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/others/string_cst2_gpopt.c
@@ -0,0 +1,15 @@
+/* { dg-options "-mxl-gp-opt" } */
+
+#include <string.h>
+
+/* { dg-final { scan-assembler "\.rodata*" } } */
+/* { dg-final { scan-assembler "\.sdata\[^2]+" } } */
+const char *string1 = "string1";
+
+char* testfunc (char *cptr)
+{
+/* { dg-final { scan-assembler "\lwi\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r13" } } */
+ strcpy (cptr, string1);
+
+ return cptr;
+}
diff --git a/gcc/testsuite/gcc.target/microblaze/others/strings1.c b/gcc/testsuite/gcc.target/microblaze/others/strings1.c
new file mode 100644
index 000000000..7a63faf79
--- /dev/null
+++ b/gcc/testsuite/gcc.target/microblaze/others/strings1.c
@@ -0,0 +1,13 @@
+/* { dg-options "-O3" } */
+
+#include <string.h>
+
+/* { dg-final { scan-assembler "\.rodata*" } } */
+extern void somefunc (char *);
+int testfunc ()
+{
+ char string2[80];
+/* { dg-final { scan-assembler "\lwi\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r0,.LC*" } } */
+ strcpy (string2, "hello");
+ somefunc (string2);
+}