URI:
       tests/libc: Add 0097-fops - scc - simple c99 compiler
  HTML git clone git://git.simple-cc.org/scc
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 10686ff83b100fbf8f51b136fe5b351be6014226
   DIR parent 442f7a3a7ae3ad6412dbee2b688a85bef45a89f7
  HTML Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
       Date:   Wed,  6 May 2026 20:58:19 +0200
       
       tests/libc: Add 0097-fops
       
       Diffstat:
         M tests/libc/execute/.gitignore       |       1 +
         A tests/libc/execute/0097-fops.c      |      39 +++++++++++++++++++++++++++++++
         M tests/libc/execute/libc-tests.lst   |       1 +
       
       3 files changed, 41 insertions(+), 0 deletions(-)
       ---
   DIR diff --git a/tests/libc/execute/.gitignore b/tests/libc/execute/.gitignore
       @@ -95,3 +95,4 @@ test.log
        0094-bsearch
        0095-abs
        0096-div
       +0097-fops
   DIR diff --git a/tests/libc/execute/0097-fops.c b/tests/libc/execute/0097-fops.c
       @@ -0,0 +1,39 @@
       +#include <assert.h>
       +#include <stdlib.h>
       +#include <stdio.h>
       +#include <string.h>
       +
       +/*
       +output:
       +testing
       +done
       +end:
       +*/
       +
       +int
       +main(void)
       +{
       +        char buff[40], *s;
       +        FILE *fp;
       +
       +        puts("testing");
       +        fp = fopen("__NOT_A_FILE", "w");
       +        assert(fp);
       +        fputs("Hello\n", fp);
       +        fflush(fp);
       +        assert(ferror(fp) == 0);
       +        fclose(fp);
       +        assert(rename("__NOT_A_FILE", "__NOT_OTHER_FILE") == 0);
       +
       +        fp = fopen("__NOT_OTHER_FILE", "r");
       +        assert(fp);
       +        s = fgets(buff, sizeof(buff), fp);
       +        assert(s != NULL);
       +        assert(strcmp(s, "Hello\n") == 0);
       +        fclose(fp);
       +
       +        assert(remove("__NOT_OTHER_FILE") == 0);
       +        puts("done");
       +
       +        return 0;
       +}
   DIR diff --git a/tests/libc/execute/libc-tests.lst b/tests/libc/execute/libc-tests.lst
       @@ -93,3 +93,4 @@
        0094-bsearch
        0095-abs
        0096-div
       +0097-fops