blob: 7d57c3539689f120199d1750618035e7f317f154 [file] [log] [blame]
Ted Kremenekcdc3a892012-08-24 20:39:55 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix,osx,alpha.unix,alpha.security.taint -analyzer-store region -verify %s
Jordan Rose5ef6e942012-07-10 23:13:01 +00002
3class Evil {
4public:
5 void system(int); // taint checker
6 void malloc(void *); // taint checker, malloc checker
7 void free(); // malloc checker, keychain checker
8 void fopen(); // stream checker
9 void feof(int, int); // stream checker
10 void open(); // unix api checker
11};
12
13void test(Evil &E) {
14 // no warnings, no crashes
15 E.system(0);
16 E.malloc(0);
17 E.free();
18 E.fopen();
19 E.feof(0,1);
20 E.open();
21}