diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-03-26 20:02:45 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-03-26 20:02:45 +0000 |
commit | 261a23bc4f7fbd525cb2f73582743252d2d2f8ac (patch) | |
tree | f3c8a991bcf4caac8dd5516247a2d92c9f77ee3b /gcc/testsuite/gcc.target/sh/sh2a-bclr.c | |
parent | 0c164b6eab526a1d0db4a3d08058262ddd476be6 (diff) | |
download | gcc-261a23bc4f7fbd525cb2f73582743252d2d2f8ac.tar.gz |
2008-03-26 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r133612 (in particular gcc/Makefile.in with auto dependencies)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@133613 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target/sh/sh2a-bclr.c')
-rw-r--r-- | gcc/testsuite/gcc.target/sh/sh2a-bclr.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/sh/sh2a-bclr.c b/gcc/testsuite/gcc.target/sh/sh2a-bclr.c new file mode 100644 index 00000000000..d4e11f95298 --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/sh2a-bclr.c @@ -0,0 +1,57 @@ +/* Testcase to check generation of a SH2A specific instruction + 'BCLR #imm3,Rn'. */ +/* { dg-do assemble {target sh*-*-*}} */ +/* { dg-options "-O1" } */ +/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ +/* { dg-final { scan-assembler "bclr"} } */ + +struct a +{ + char a, b; + short c; +}; + +/* This function generates the instruction "BCLR #imm3,Rn" only + on using optimization option "-O1" and above. */ + +int +a2 () +{ + volatile int j; + volatile static struct a x = {1, 66, ~1}, y = {1, 2, ~2}; + + if (j > 1) + return (x.a == y.a && (x.b & ~1) == y.b); + if (j > 2) + return (x.a == y.a && (x.b & ~2) == y.b); + if (j > 3) + return (x.a == y.a && (x.b & ~4) == y.b); + if (j > 4) + return (x.a == y.a && (x.b & ~8) == y.b); + if (j > 5) + return (x.a == y.a && (x.b & ~16) == y.b); + if (j > 6) + return (x.a == y.a && (x.b & ~32) == y.b); + if (j > 7) + return (x.a == y.a && (x.b & ~64) == y.b); + if (j > 8) + return (x.a == y.a && (x.b & ~128) == y.b); +} + +int +main () +{ + volatile unsigned char x; + + x &= 0xFE; + x &= 0xFD; + x &= 0xFB; + x &= 0xF7; + x &= 0xEF; + x &= 0xDF; + x &= 0xBF; + x &= 0x7F; + + if (!a2 ()) + return 0; +} |