1 /* { dg-skip-if "" { powerpc*-*-aix* } } */
2 /* { dg-skip-if "" { "avr-*-*" } } */
5 #include "../../gcc.dg/analyzer/analyzer-decls.h"
7 extern int isatty(int fd
);
8 extern int close(int fd
);
10 int test_pass_through (int fd
)
15 void test_merging (int fd
)
18 __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */
21 int test_outcomes (int fd
)
24 int result
= isatty (fd
);
28 __analyzer_dump_path (); /* { dg-bogus "path" } */
31 __analyzer_dump_path (); /* { dg-message "path" } */
32 __analyzer_eval (errno
> 0); /* { dg-warning "TRUE" } */
35 __analyzer_dump_path (); /* { dg-message "path" } */
36 __analyzer_eval (errno
== 0); /* { dg-warning "TRUE" } */
42 int test_isatty_on_invalid_fd (void)
45 int result
= isatty (-1);
46 __analyzer_eval (result
== 0); /* { dg-warning "TRUE" } */
47 __analyzer_eval (errno
> 0); /* { dg-warning "TRUE" } */
51 int test_isatty_on_closed_fd (int fd
)
55 int result
= isatty (fd
);
56 __analyzer_eval (result
== 0); /* { dg-warning "TRUE" } */
57 __analyzer_eval (errno
> 0); /* { dg-warning "TRUE" } */