testsuite: Skip analyzer tests on AIX.
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / file-uninit-1.c
blob0f8ac5442b16a33bed425650a8953e10bbd11a8a
1 /* Verify that we check for uninitialized values passed to functions
2 that we have special-cased state-machine handling for. */
4 typedef struct FILE FILE;
6 FILE* fopen (const char*, const char*);
7 int fclose (FILE*);
8 int fseek (FILE *, long, int);
10 FILE *
11 test_fopen_uninit_path (void)
13 const char *path;
14 FILE *f = fopen (path, "r"); /* { dg-warning "use of uninitialized value 'path'" } */
15 return f;
18 FILE *
19 test_fopen_uninit_mode (const char *path)
21 const char *mode;
22 FILE *f = fopen (path, mode); /* { dg-warning "use of uninitialized value 'mode'" } */
23 return f;
26 void
27 test_fclose_uninit (void)
29 FILE *f;
30 fclose (f); /* { dg-warning "use of uninitialized value 'f'" } */
33 int
34 test_fseek_uninit_stream (void)
36 FILE *stream;
37 return fseek (stream, 0, 0); /* { dg-warning "use of uninitialized value 'stream'" } */
40 int
41 test_fseek_uninit_offset (FILE *stream, int whence)
43 long offset;
44 return fseek (stream, offset, whence); /* { dg-warning "use of uninitialized value 'offset'" } */
47 int
48 test_fseek_uninit_whence (FILE *stream, long offset)
50 int whence;
51 return fseek (stream, offset, whence); /* { dg-warning "use of uninitialized value 'whence'" } */