OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libmudflap/] [testsuite/] [libmudflap.c/] [pass52-frag.c] - Blame information for rev 738

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 738 jeremybenn
#include <stdio.h>
2
 
3
 
4
void writestuff (FILE *f)
5
{
6
  fprintf (f, "hello world\n");
7
  fputc ('y', f);
8
  putc ('e', f);
9
}
10
 
11
void readstuff (FILE *f)
12
{
13
  int c, d;
14
  char stuff[100], *s;
15
  c = fgetc (f);
16
  ungetc (c, f);
17
  d = fgetc (f);
18
  s = fgets (stuff, sizeof(stuff), f);
19
}
20
 
21
int main ()
22
{
23
  FILE *f;
24
  writestuff (stdout);
25
  writestuff (stderr);
26
  f = fopen ("/dev/null", "w");
27
  writestuff (f);
28
  fclose (f);
29
  f = fopen ("/dev/zero", "r");
30
  readstuff (f);
31
  f = freopen ("/dev/null", "w", f);
32
  writestuff (f);
33
  fclose (f);
34
 
35
  return 0;
36
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.