summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-18 07:52:53 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-18 07:52:53 +0000
commit3e055d82d9f2fea78f7c7287c09d1cbfacd7f514 (patch)
tree6549d97285ea079c388418550c41de587a9f4cd2 /gcc/testsuite
parenta3026c1883badfb4ae04dc31b4025497276d9205 (diff)
downloadgcc-3e055d82d9f2fea78f7c7287c09d1cbfacd7f514.tar.gz
gcc/
* doc/md.texi: Document the new PowerPC "es" constraint. Document that "m" can include automodified addresses on this target, and explain how %U must be used. Extend the "Q" and "Z" documentation to suggest "es" as well as "m". * config/rs6000/constraints.md (es): New memory constraint. (Q, Z): Update strings to match new documentation. gcc/testsuite/ * gcc.target/powerpc/asm-es-1.c: New test. * gcc.target/powerpc/asm-es-2.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149766 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/powerpc/asm-es-1.c32
-rw-r--r--gcc/testsuite/gcc.target/powerpc/asm-es-2.c37
3 files changed, 74 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3b704d52235..5f08b2d963c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-18 Richard Sandiford <r.sandiford@uk.ibm.com>
+
+ * gcc.target/powerpc/asm-es-1.c: New test.
+ * gcc.target/powerpc/asm-es-2.c: Likewise.
+
2009-07-17 Richard Guenther <rguenther@suse.de>
PR c/40401
diff --git a/gcc/testsuite/gcc.target/powerpc/asm-es-1.c b/gcc/testsuite/gcc.target/powerpc/asm-es-1.c
new file mode 100644
index 00000000000..fe3e899d5a2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/asm-es-1.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+static inline void __attribute__((always_inline))
+f1 (void)
+{
+ long unused;
+ asm volatile ("" : "=es" (unused) :: "memory");
+}
+
+static void __attribute__((noinline))
+f2 (long *val)
+{
+ *val = 0x1234;
+}
+
+static long __attribute__((noinline))
+test (void)
+{
+ f1 ();
+ {
+ long val;
+ f2 (&val);
+ return val;
+ }
+}
+
+int
+main (void)
+{
+ return test () != 0x1234;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/asm-es-2.c b/gcc/testsuite/gcc.target/powerpc/asm-es-2.c
new file mode 100644
index 00000000000..e9319654cc7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/asm-es-2.c
@@ -0,0 +1,37 @@
+/* { dg-options "-O2" } */
+void
+f1 (int *p, int x)
+{
+ asm ("asm1 %0" : "=es" (p[x]));
+}
+
+void
+f2 (int *p)
+{
+ while (1)
+ {
+ p += 4;
+ asm ("asm2%U0 %0" : "=m" (*p));
+ }
+}
+
+void
+f3 (int *p)
+{
+ while (1)
+ {
+ p += 4;
+ asm ("asm3%U0 %0" : "=es" (*p));
+ }
+}
+
+void
+f4 (int *p)
+{
+ asm ("asm4 %0" : "=es" (p[100]));
+}
+
+/* { dg-final { scan-assembler "asm1 3,4" } } */
+/* { dg-final { scan-assembler "asm2u 16\\(3\\)" } } */
+/* { dg-final { scan-assembler "asm3 0\\(3\\)" } } */
+/* { dg-final { scan-assembler "asm4 400\\(3\\)" } } */