From 0a5fe1ec9617ce01a4ee7a65c969ec32f2ec0c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Sch=C3=BCssele?= Date: Tue, 21 Feb 2023 19:00:27 +0100 Subject: [PATCH] Fix test --- trunk/examples/programs/regression/c/fscanf.c | 49 ++++++++++++++++++- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/trunk/examples/programs/regression/c/fscanf.c b/trunk/examples/programs/regression/c/fscanf.c index fb4bcccf847..1f77fcaa1fd 100644 --- a/trunk/examples/programs/regression/c/fscanf.c +++ b/trunk/examples/programs/regression/c/fscanf.c @@ -3,10 +3,55 @@ Author: Frank Schüssele (schuessf@informatik.uni-freiburg.de) Date: 2023-02-21 */ -#include +typedef long int __off_t; +typedef long int __off64_t; +struct _IO_FILE; +typedef struct _IO_FILE __FILE; +struct _IO_FILE; +typedef struct _IO_FILE FILE; +struct _IO_FILE; +struct _IO_marker; +struct _IO_codecvt; +struct _IO_wide_data; +typedef void _IO_lock_t; +struct _IO_FILE +{ + int _flags; + char *_IO_read_ptr; + char *_IO_read_end; + char *_IO_read_base; + char *_IO_write_base; + char *_IO_write_ptr; + char *_IO_write_end; + char *_IO_buf_base; + char *_IO_buf_end; + char *_IO_save_base; + char *_IO_backup_base; + char *_IO_save_end; + struct _IO_marker *_markers; + struct _IO_FILE *_chain; + int _fileno; + int _flags2; + __off_t _old_offset; + unsigned short _cur_column; + signed char _vtable_offset; + char _shortbuf[1]; + _IO_lock_t *_lock; + __off64_t _offset; + struct _IO_codecvt *_codecvt; + struct _IO_wide_data *_wide_data; + struct _IO_FILE *_freeres_list; + void *_freeres_buf; + size_t __pad5; + int _mode; + char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; +}; +extern int fscanf (FILE *__restrict __stream, + const char *__restrict __format, ...) ; +extern FILE* stdin; int main() { int x; - int r = scanf("%d", &x); + int r = fscanf(stdin, "%d", &x); //@ assert r == 1 || x == 0; }