[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Analysis / std-c-library-functions-eof.c
blob0b09a1c63d97bff239034ea067c9aed17c96f952
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,apiModeling.StdCLibraryFunctions,debug.ExprInspection -verify -analyzer-config eagerly-assume=false %s
2 // RUN: %clang_analyze_cc1 -triple i686-unknown-linux -analyzer-checker=core,apiModeling.StdCLibraryFunctions,debug.ExprInspection -verify -analyzer-config eagerly-assume=false %s
3 // RUN: %clang_analyze_cc1 -triple x86_64-unknown-linux -analyzer-checker=core,apiModeling.StdCLibraryFunctions,debug.ExprInspection -verify -analyzer-config eagerly-assume=false %s
4 // RUN: %clang_analyze_cc1 -triple armv7-a15-linux -analyzer-checker=core,apiModeling.StdCLibraryFunctions,debug.ExprInspection -verify -analyzer-config eagerly-assume=false %s
5 // RUN: %clang_analyze_cc1 -triple thumbv7-a15-linux -analyzer-checker=core,apiModeling.StdCLibraryFunctions,debug.ExprInspection -verify -analyzer-config eagerly-assume=false %s
7 void clang_analyzer_eval(int);
9 typedef struct FILE FILE;
10 // Unorthodox EOF value.
11 #define EOF (-2)
13 int getc(FILE *);
14 void test_getc(FILE *fp) {
16 int x;
17 while ((x = getc(fp)) != EOF) {
18 clang_analyzer_eval(x > 255); // expected-warning{{FALSE}}
19 clang_analyzer_eval(x >= 0); // expected-warning{{TRUE}}
22 int y = getc(fp);
23 if (y < 0) {
24 clang_analyzer_eval(y == -2); // expected-warning{{TRUE}}