diff mbox

pr63856 - test case

Message ID 1416767547-19169-1-git-send-email-tsaunders@mozilla.com
State New
Headers show

Commit Message

Trevor Saunders Nov. 23, 2014, 6:32 p.m. UTC
From: Trevor Saunders <tsaunders@mozilla.com>

Hi,

bug was already fixed, so just add the test case.

tested this only passes with r217909 where it is fixed, ok?

Trev

Comments

Jakub Jelinek Nov. 23, 2014, 6:58 p.m. UTC | #1
On Sun, Nov 23, 2014 at 01:32:27PM -0500, tsaunders@mozilla.com wrote:
> bug was already fixed, so just add the test case.
> 
> tested this only passes with r217909 where it is fixed, ok?
> 
> Trev
> 
> 
> diff --git a/gcc/testsuite/gcc.dg/pr63856.c b/gcc/testsuite/gcc.dg/pr63856.c
> new file mode 100644
> index 0000000..8fb65c6
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/pr63856.c
> @@ -0,0 +1,14 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -fPIC" } */
> +typedef int v2si __attribute__ ((vector_size (8)));
> +typedef short v4hi __attribute__ ((vector_size (8)));
> +
> +int __attribute__ ((noinline, noclone)) f (v2si A, int N)

Vector arguments or return values often result in -Wpsabi warnings,
so you certainly want -Wno-psabi in dg-options.
On the other side, -fPIC should be only used for { target pic },
so better put that into dg-additional-options.

> +{
> +  return ((v4hi) A)[N];
> +}
> +
> +int __attribute__ ((noinline, noclone)) g (v2si A, int N)
> +{
> +  return ((v4hi) A)[N];
> +}
> -- 
> 2.1.3

	Jakub
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.dg/pr63856.c b/gcc/testsuite/gcc.dg/pr63856.c
new file mode 100644
index 0000000..8fb65c6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr63856.c
@@ -0,0 +1,14 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O2 -fPIC" } */
+typedef int v2si __attribute__ ((vector_size (8)));
+typedef short v4hi __attribute__ ((vector_size (8)));
+
+int __attribute__ ((noinline, noclone)) f (v2si A, int N)
+{
+  return ((v4hi) A)[N];
+}
+
+int __attribute__ ((noinline, noclone)) g (v2si A, int N)
+{
+  return ((v4hi) A)[N];
+}