diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-12-11 18:42:31 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-12-11 18:42:31 +0000 |
commit | e197f24a7746f8c47ff6ff376a77f721193094da (patch) | |
tree | fe1a0c97868bcea26ef29cf0e5a090f2d16a341c /gcc/testsuite | |
parent | c76a0273e525cfe0ed421c99f1f6112585472193 (diff) | |
download | gcc-e197f24a7746f8c47ff6ff376a77f721193094da.tar.gz |
PR target/54121
* config/sparc/sparc.md (tldo_stb_sp32): Fix pasto.
(tldo_stb_sp64): Likewise.
(tldo_sth_sp32): Likewise.
(tldo_sth_sp64): Likewise.
(tldo_stw_sp32): Likewise.
(tldo_stw_sp64): Likewise.
(tldo_stx_sp64): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194410 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr54121.c | 94 |
2 files changed, 98 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c6c8bead6c4..88e2eecffcd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2012-12-11 Eric Botcazou <ebotcazou@adacore.com> + + * gcc.dg/pr54121.c: New test. + 2012-12-11 Jakub Jelinek <jakub@redhat.com> PR c++/55619 diff --git a/gcc/testsuite/gcc.dg/pr54121.c b/gcc/testsuite/gcc.dg/pr54121.c new file mode 100644 index 00000000000..b9a208ea84e --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr54121.c @@ -0,0 +1,94 @@ +/* PR target/54121 */ +/* Reported by Jan Engelhardt <jengelh@inai.de> */ + +/* { dg-do compile { target fpic } } */ +/* { dg-options "-std=gnu99 -O -fPIC -fprofile-generate" } */ + +typedef __SIZE_TYPE__ size_t; +typedef unsigned char uint8_t; + +extern void *memcpy (void *__restrict __dest, + __const void *__restrict __src, size_t __n) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); + +typedef enum { + LZMA_OK = 0, + LZMA_STREAM_END = 1, + LZMA_NO_CHECK = 2, + LZMA_UNSUPPORTED_CHECK = 3, + LZMA_GET_CHECK = 4, + LZMA_MEM_ERROR = 5, + LZMA_MEMLIMIT_ERROR = 6, + LZMA_FORMAT_ERROR = 7, + LZMA_OPTIONS_ERROR = 8, + LZMA_DATA_ERROR = 9, + LZMA_BUF_ERROR = 10, + LZMA_PROG_ERROR = 11, +} lzma_ret; + +typedef enum { + LZMA_RUN = 0, + LZMA_SYNC_FLUSH = 1, + LZMA_FULL_FLUSH = 2, + LZMA_FINISH = 3 +} lzma_action; + +typedef struct { + void *( *alloc)(void *opaque, size_t nmemb, size_t size); + void ( *free)(void *opaque, void *ptr); + void *opaque; +} lzma_allocator; + +typedef struct lzma_coder_s lzma_coder; + +typedef struct lzma_next_coder_s lzma_next_coder; + +typedef struct lzma_filter_info_s lzma_filter_info; + +typedef lzma_ret (*lzma_init_function)( + lzma_next_coder *next, lzma_allocator *allocator, + const lzma_filter_info *filters); + +typedef lzma_ret (*lzma_code_function)( + lzma_coder *coder, lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, + lzma_action action); + +typedef void (*lzma_end_function)( + lzma_coder *coder, lzma_allocator *allocator); + +typedef struct { + uint8_t *buf; + size_t pos; + size_t size; +} lzma_dict; + +typedef struct { + lzma_coder *coder; + lzma_ret (*code)(lzma_coder *restrict coder, + lzma_dict *restrict dict, const uint8_t *restrict in, + size_t *restrict in_pos, size_t in_size); +} lzma_lz_decoder; + +struct lzma_coder_s { + lzma_dict dict; + lzma_lz_decoder lz; +}; + +lzma_ret +decode_buffer(lzma_coder *coder, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, size_t *restrict out_pos) +{ + while (1) { + const size_t dict_start = coder->dict.pos; + const lzma_ret ret + = coder->lz.code( coder->lz.coder, &coder->dict, in, in_pos, in_size); + const size_t copy_size = coder->dict.pos - dict_start; + memcpy(out + *out_pos, coder->dict.buf + dict_start, copy_size); + if (ret != LZMA_OK || coder->dict.pos < coder->dict.size) + return ret; + } +} |