1 // RUN: %clang_analyze_cc1 -verify %s \
2 // RUN: -analyzer-checker=core \
3 // RUN: -analyzer-checker=apiModeling.Errno \
4 // RUN: -analyzer-checker=debug.ErrnoTest \
5 // RUN: -analyzer-checker=alpha.unix.Errno \
6 // RUN: -analyzer-config alpha.unix.Errno:AllowErrnoReadOutsideConditionExpressions=false \
9 // RUN: %clang_analyze_cc1 -verify %s \
10 // RUN: -analyzer-checker=core \
11 // RUN: -analyzer-checker=apiModeling.Errno \
12 // RUN: -analyzer-checker=debug.ErrnoTest \
13 // RUN: -analyzer-checker=alpha.unix.Errno \
14 // RUN: -analyzer-config alpha.unix.Errno:AllowErrnoReadOutsideConditionExpressions=false \
17 #include "Inputs/system-header-simulator.h"
19 #include "Inputs/errno_var.h"
22 #include "Inputs/errno_func.h"
25 int ErrnoTesterChecker_setErrnoIfError();
28 ErrnoTesterChecker_setErrnoIfError();
29 int A
= errno
? 1 : 2;
30 // expected-warning@-1{{An undefined value may be read from 'errno'}}
33 void test_errno_store_into_variable() {
34 ErrnoTesterChecker_setErrnoIfError();
36 // expected-warning@-1{{An undefined value may be read from 'errno'}}
39 void test_errno_store_into_variable_in_expr() {
40 ErrnoTesterChecker_setErrnoIfError();
42 // expected-warning@-1{{An undefined value may be read from 'errno'}}
45 int test_errno_return() {
46 ErrnoTesterChecker_setErrnoIfError();
48 // expected-warning@-1{{An undefined value may be read from 'errno'}}
51 int test_errno_return_expr() {
52 ErrnoTesterChecker_setErrnoIfError();
54 // expected-warning@-1{{An undefined value may be read from 'errno'}}