2 /* Reported by Jan Engelhardt <jengelh@inai.de> */
4 /* { dg-do compile { target fpic } } */
5 /* { dg-options "-std=gnu99 -O -fPIC -fprofile-generate" } */
6 /* { dg-require-profiling "-fprofile-generate" } */
8 typedef __SIZE_TYPE__
size_t;
9 typedef unsigned char uint8_t;
11 extern void *memcpy (void *__restrict __dest
,
12 __const
void *__restrict __src
, size_t __n
)
13 __attribute__ ((__nothrow__
)) __attribute__ ((__nonnull__ (1, 2)));
19 LZMA_UNSUPPORTED_CHECK
= 3,
22 LZMA_MEMLIMIT_ERROR
= 6,
23 LZMA_FORMAT_ERROR
= 7,
24 LZMA_OPTIONS_ERROR
= 8,
38 void *( *alloc
)(void *opaque
, size_t nmemb
, size_t size
);
39 void ( *free
)(void *opaque
, void *ptr
);
43 typedef struct lzma_coder_s lzma_coder
;
45 typedef struct lzma_next_coder_s lzma_next_coder
;
47 typedef struct lzma_filter_info_s lzma_filter_info
;
49 typedef lzma_ret (*lzma_init_function
)(
50 lzma_next_coder
*next
, lzma_allocator
*allocator
,
51 const lzma_filter_info
*filters
);
53 typedef lzma_ret (*lzma_code_function
)(
54 lzma_coder
*coder
, lzma_allocator
*allocator
,
55 const uint8_t *restrict in
, size_t *restrict in_pos
,
56 size_t in_size
, uint8_t *restrict out
,
57 size_t *restrict out_pos
, size_t out_size
,
60 typedef void (*lzma_end_function
)(
61 lzma_coder
*coder
, lzma_allocator
*allocator
);
71 lzma_ret (*code
)(lzma_coder
*restrict coder
,
72 lzma_dict
*restrict dict
, const uint8_t *restrict in
,
73 size_t *restrict in_pos
, size_t in_size
);
82 decode_buffer(lzma_coder
*coder
,
83 const uint8_t *restrict in
, size_t *restrict in_pos
,
84 size_t in_size
, uint8_t *restrict out
, size_t *restrict out_pos
)
87 const size_t dict_start
= coder
->dict
.pos
;
89 = coder
->lz
.code( coder
->lz
.coder
, &coder
->dict
, in
, in_pos
, in_size
);
90 const size_t copy_size
= coder
->dict
.pos
- dict_start
;
91 memcpy(out
+ *out_pos
, coder
->dict
.buf
+ dict_start
, copy_size
);
92 if (ret
!= LZMA_OK
|| coder
->dict
.pos
< coder
->dict
.size
)