aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2014-03-25 22:37:19 -0700
committerBen Cheng <bccheng@google.com>2014-03-25 22:37:19 -0700
commit1bc5aee63eb72b341f506ad058502cd0361f0d10 (patch)
treec607e8252f3405424ff15bc2d00aa38dadbb2518 /gcc-4.9/gcc/testsuite/gcc.target/microblaze/others
parent283a0bf58fcf333c58a2a92c3ebbc41fb9eb1fdb (diff)
downloadtoolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.gz
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.bz2
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.zip
Initial checkin of GCC 4.9.0 from trunk (r208799).
Change-Id: I48a3c08bb98542aa215912a75f03c0890e497dba
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/microblaze/others')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/builtin-trap.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/data_var1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/data_var2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/data_var3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/interrupt_handler_leaf.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/mem_reload.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var4.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var5.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var6.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/string_cst1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/string_cst1_gpopt.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/string_cst2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/string_cst2_gpopt.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/strings1.c13
17 files changed, 267 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/builtin-trap.c b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/builtin-trap.c
new file mode 100644
index 000000000..fdcde1fa7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/builtin-trap.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+
+void trap ()
+{
+ __builtin_trap ();
+}
+
+/* { dg-final { scan-assembler "brki\tr0,-1" } } */ \ No newline at end of file
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/data_var1.c b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/data_var1.c
new file mode 100644
index 000000000..15b85ca77
--- /dev/null
+++ b/gcc-4.9/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-4.9/gcc/testsuite/gcc.target/microblaze/others/data_var2.c b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/data_var2.c
new file mode 100644
index 000000000..9fb7347ba
--- /dev/null
+++ b/gcc-4.9/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-4.9/gcc/testsuite/gcc.target/microblaze/others/data_var3.c b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/data_var3.c
new file mode 100644
index 000000000..2b3f06410
--- /dev/null
+++ b/gcc-4.9/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-4.9/gcc/testsuite/gcc.target/microblaze/others/interrupt_handler_leaf.c b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/interrupt_handler_leaf.c
new file mode 100644
index 000000000..9d068d05e
--- /dev/null
+++ b/gcc-4.9/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-4.9/gcc/testsuite/gcc.target/microblaze/others/mem_reload.c b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/mem_reload.c
new file mode 100644
index 000000000..e285fb821
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/mem_reload.c
@@ -0,0 +1,74 @@
+/* { dg-options "-O2 -fPIC" } */
+
+typedef struct test_struct
+{
+ unsigned long long h[8];
+ unsigned long long Nl,Nh;
+ union {
+ unsigned long long d[16];
+ unsigned char p[(16*8)];
+ } u;
+ unsigned int num,md_len;
+} TEST_STRUCT;
+
+static const unsigned long long K512[12] = {
+ 0x428a2f98d728ae22,0x7137449123ef65cd,
+ 0xb5c0fbcfec4d3b2f,0xe9b5dba58189dbbc,
+ 0x3956c25bf348b538,0x59f111f1b605d019,
+ 0x923f82a4af194f9b,0xab1c5ed5da6d8118,
+ 0xd807aa98a3030242,0x12835b0145706fbe,
+ 0x243185be4ee4b28c,0x550c7dc3d5ffb4e2};
+
+#define ROTR(x,s) (((x)>>s) | (x)<<(64-s))
+#define Sigma0(x) (ROTR((x),28) ^ ROTR((x),34) ^ ROTR((x),39))
+#define Sigma1(x) (ROTR((x),14) ^ ROTR((x),18) ^ ROTR((x),41))
+#define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z)))
+#define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
+
+#define ROUND_00_15(i,a,b,c,d,e,f,g,h) do { \
+ T1 += h + Sigma1(e) + Ch(e,f,g) + K512[i]; \
+ h = Sigma0(a) + Maj(a,b,c); \
+ d += T1; h += T1; } while (0)
+
+#define ROUND_16_80(i,a,b,c,d,e,f,g,h,X) do { \
+ T1 = X[(i)&0x0f] += s0 + s1 + X[(i+9)&0x0f]; \
+ ROUND_00_15(i,a,b,c,d,e,f,g,h); } while (0)
+
+static void testfunc1 (TEST_STRUCT *ctx, const void *in, unsigned int num)
+{
+ const unsigned long long *W=in;
+ unsigned long long a,b,c,d,e,f,g,h,s0,s1,T1;
+ unsigned long long X[16];
+ int i;
+
+ while (num--) {
+
+ T1 = X[0] = W[0]; ROUND_00_15(0,a,b,c,d,e,f,g,h);
+ T1 = X[1] = W[1]; ROUND_00_15(1,h,a,b,c,d,e,f,g);
+ T1 = X[2] = W[2]; ROUND_00_15(2,g,h,a,b,c,d,e,f);
+ T1 = X[3] = W[3]; ROUND_00_15(3,f,g,h,a,b,c,d,e);
+ T1 = X[4] = W[4]; ROUND_00_15(4,e,f,g,h,a,b,c,d);
+ T1 = X[5] = W[5]; ROUND_00_15(5,d,e,f,g,h,a,b,c);
+ T1 = X[6] = W[6]; ROUND_00_15(6,c,d,e,f,g,h,a,b);
+ T1 = X[7] = W[7]; ROUND_00_15(7,b,c,d,e,f,g,h,a);
+ T1 = X[8] = W[8]; ROUND_00_15(8,a,b,c,d,e,f,g,h);
+ T1 = X[9] = W[9]; ROUND_00_15(9,h,a,b,c,d,e,f,g);
+
+ for (i=16;i<80;i+=8)
+ {
+ ROUND_16_80(i+0,a,b,c,d,e,f,g,h,X);
+ }
+
+ ctx->h[4] += e; ctx->h[5] += f; ctx->h[6] += g; ctx->h[7] += h;
+ }
+}
+
+int testfunc2 (TEST_STRUCT *c, const void *_data, unsigned int len)
+{
+ const unsigned char *data=(const unsigned char *)_data;
+
+ unsigned char *p=(unsigned char *)c->u.p;
+
+ testfunc1 (c,p,0);
+ testfunc1 (c,data,len/sizeof(c->u));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var1.c b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var1.c
new file mode 100644
index 000000000..2337f5a1e
--- /dev/null
+++ b/gcc-4.9/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-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var2.c b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var2.c
new file mode 100644
index 000000000..1c91d0043
--- /dev/null
+++ b/gcc-4.9/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-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var3.c b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var3.c
new file mode 100644
index 000000000..07c80041c
--- /dev/null
+++ b/gcc-4.9/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-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var4.c b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var4.c
new file mode 100644
index 000000000..4dfa337d5
--- /dev/null
+++ b/gcc-4.9/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-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var5.c b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var5.c
new file mode 100644
index 000000000..5c61962bf
--- /dev/null
+++ b/gcc-4.9/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-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var6.c b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/sdata_var6.c
new file mode 100644
index 000000000..0c8fe431f
--- /dev/null
+++ b/gcc-4.9/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-4.9/gcc/testsuite/gcc.target/microblaze/others/string_cst1.c b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/string_cst1.c
new file mode 100644
index 000000000..2a74f4ce7
--- /dev/null
+++ b/gcc-4.9/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-4.9/gcc/testsuite/gcc.target/microblaze/others/string_cst1_gpopt.c b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/string_cst1_gpopt.c
new file mode 100644
index 000000000..5b5d3db18
--- /dev/null
+++ b/gcc-4.9/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-4.9/gcc/testsuite/gcc.target/microblaze/others/string_cst2.c b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/string_cst2.c
new file mode 100644
index 000000000..c375339dc
--- /dev/null
+++ b/gcc-4.9/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-4.9/gcc/testsuite/gcc.target/microblaze/others/string_cst2_gpopt.c b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/string_cst2_gpopt.c
new file mode 100644
index 000000000..057e8c447
--- /dev/null
+++ b/gcc-4.9/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-4.9/gcc/testsuite/gcc.target/microblaze/others/strings1.c b/gcc-4.9/gcc/testsuite/gcc.target/microblaze/others/strings1.c
new file mode 100644
index 000000000..7a63faf79
--- /dev/null
+++ b/gcc-4.9/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);
+}