diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-17 13:19:46 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-17 13:19:46 +0000 |
commit | b4f314ea97f04620d290f3ae25d831f46692864f (patch) | |
tree | e99df6f0f35dce95dacd7a91b0242e81462a0860 /gcc/testsuite/gcc.target/i386/vec-may_alias.c | |
parent | 644412e1c29a2984b1b37656c18fe9f33791eff1 (diff) | |
parent | 7de380af566c189319d706d3b4ab04e32ecc5d90 (diff) | |
download | gcc-b4f314ea97f04620d290f3ae25d831f46692864f.tar.gz |
Merge from trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@209485 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/vec-may_alias.c')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/vec-may_alias.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/vec-may_alias.c b/gcc/testsuite/gcc.target/i386/vec-may_alias.c new file mode 100644 index 00000000000..e970497454f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vec-may_alias.c @@ -0,0 +1,25 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -w -Wno-abi" } */ + +typedef int v2si __attribute__ ((vector_size (8))); +typedef short v4hi __attribute__ ((vector_size (8))); +typedef short v4hia __attribute__ ((vector_size (8), may_alias)); + +__attribute__ ((noinline, noclone)) +int f (v2si A, int N) +{ return ((v4hia)A)[N]; } + +__attribute__ ((noinline, noclone)) +int g (v2si A, int N) +{ return ((v4hi)A)[N]; } + +int main() +{ + v2si x = { 0, 0 }, y = { 1, 1 }; + if (f (x, 0) || f (x, 1) || f (x, 2) || f (x, 3)) + __builtin_abort (); + if (g (y, 0) != 1 || g (y, 1) || g (y, 2) != 1 || g (y, 3)) + __builtin_abort (); + return 0; +} + |