diff options
author | rask <rask@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-16 20:01:20 +0000 |
---|---|---|
committer | rask <rask@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-16 20:01:20 +0000 |
commit | 067fd73fa7c855ae6596473bd8dac2658155a985 (patch) | |
tree | 3af515038a16c8b8d0893cd19741a7a4a5b5d4e0 /gcc/testsuite/gcc.c-torture | |
parent | 5e13091d5313c768a47371c450fabde2cc2dc3a7 (diff) | |
download | gcc-067fd73fa7c855ae6596473bd8dac2658155a985.tar.gz |
2007-07-16 Rask Ingemann Lambertsen <rask@sygehus.dk>
* gcc.c-torture/execute/20061101-2.c: Variant of 20061101-1.c
adapted to work on targets with 16-bit or wider int.
* gcc.c-torture/execute/pr29797-2.c: Likewise for pr29797-1.c.
* gcc.c-torture/execute/pr31448-2.c: Likewise for pr31448.c.
* gcc.dg/20061109-2.c: Likewise for 20061109-1.c.
* gcc.dg/pr27959-2.c: Likewise for pr27959.c.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126693 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20061101-2.c | 32 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr29797-2.c | 14 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr31448-2.c | 36 |
3 files changed, 82 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/20061101-2.c b/gcc/testsuite/gcc.c-torture/execute/20061101-2.c new file mode 100644 index 00000000000..d5b1046e523 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20061101-2.c @@ -0,0 +1,32 @@ +/* PR rtl-optimization/28970 */ +/* Origin: Peter Bergner <bergner@vnet.ibm.com> */ + +extern void abort (void); + +int tar (long i) +{ + if (i != 36863) + abort (); + + return -1; +} + +void bug(int q, long bcount) +{ + int j = 0; + int outgo = 0; + + while(j != -1) + { + outgo++; + if (outgo > q-1) + outgo = q-1; + j = tar (outgo*bcount); + } +} + +int main(void) +{ + bug(5, 36863); + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/execute/pr29797-2.c b/gcc/testsuite/gcc.c-torture/execute/pr29797-2.c new file mode 100644 index 00000000000..9313bf4c635 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr29797-2.c @@ -0,0 +1,14 @@ +extern void abort(void); + +unsigned long bar(void) { return 32768; } + +int main() +{ + unsigned long nStyle = bar (); + if (nStyle & 32768) + nStyle |= 65536; + if (nStyle != (32768 | 65536)) + abort (); + return 0; +} + diff --git a/gcc/testsuite/gcc.c-torture/execute/pr31448-2.c b/gcc/testsuite/gcc.c-torture/execute/pr31448-2.c new file mode 100644 index 00000000000..ad920c9d00e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr31448-2.c @@ -0,0 +1,36 @@ +/* PR middle-end/31448, this used to ICE during expand because + reduce_to_bit_field_precision was not ready to handle constants. */ + +typedef struct _st { + long int iIndex : 24; + long int iIndex1 : 24; +} st; +st *next; +void g(void) +{ + st *next = 0; + int nIndx; + const static int constreg[] = { 0,}; + nIndx = 0; + next->iIndex = constreg[nIndx]; +} +void f(void) +{ + int nIndx; + const static long int constreg[] = { 0xFEFEFEFE,}; + nIndx = 0; + next->iIndex = constreg[nIndx]; + next->iIndex1 = constreg[nIndx]; +} +int main(void) +{ + st a; + next = &a; + f(); + if (next->iIndex != 0xFFFEFEFE) + __builtin_abort (); + if (next->iIndex1 != 0xFFFEFEFE) + __builtin_abort (); + return 0; +} + |