summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/microblaze/others
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/others
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/others')
-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
15 files changed, 185 insertions, 0 deletions
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);
+}