1 /* { dg-do compile } */
2 /* { dg-options "-c -O2 -Wextra" } */
3 #define O_RDONLY (1<<0)
4 #define O_WRONLY (1<<1)
5 #define O_RDWR (O_RDONLY|O_WRONLY)
12 OM_READWRITE_NOCREATE,
16 extern int open(const char *name, int mode);
18 void open_file(const char *filename, const OpenMode rw)
25 mode = O_WRONLY|O_CREAT|O_TRUNC;
30 case OM_READWRITE_NOCREATE:
33 case OM_READWRITE_CREATE:
34 mode = O_RDWR|O_CREAT|O_TRUNC;
38 open( filename, mode );