scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 64a1f225d840052dec81d9341c41843de7551af6
parent d4cfe5537eec4ef65c227c5642ce72bb34596490
Author: Lennart Jablonka <humm@ljabl.com>
Date:   Sun, 12 Apr 2026 14:23:24 +0200

tests/libc: add test for fseek

Diffstat:
Mtests/libc/execute/.gitignore | 1+
Atests/libc/execute/0068-fseek.c | 19+++++++++++++++++++
Mtests/libc/execute/libc-tests.lst | 1+
3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/tests/libc/execute/.gitignore b/tests/libc/execute/.gitignore @@ -66,3 +66,4 @@ test.log 0065-btowc 0066-wctob 0067-wcwidth +0068-fseek diff --git a/tests/libc/execute/0068-fseek.c b/tests/libc/execute/0068-fseek.c @@ -0,0 +1,19 @@ +/* +output: +202 +end: +*/ + +#include <stdio.h> + +int +main(void) +{ + FILE *fp = fopen(__FILE__, "r"); + if (fp == 0) { + perror(__FILE__); + return 1; + } + fseek(fp, 0, SEEK_END); + printf("%ld\n", ftell(fp)); +} diff --git a/tests/libc/execute/libc-tests.lst b/tests/libc/execute/libc-tests.lst @@ -64,3 +64,4 @@ 0065-btowc 0066-wctob 0067-wcwidth [TODO] +0068-fseek