1 // RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-experimental-checks -analyzer-store region -verify %s
3 extern int chroot(const char* path
);
4 extern int chdir(const char* path
);
10 chroot("/usr/local"); // root changed.
11 foo(); // expected-warning {{No call of chdir("/") immediately after chroot}}
15 chroot("/usr/local"); // root changed.
16 chdir("/"); // enter the jail.
21 chroot("/usr/local"); // root changed.
22 chdir("../"); // change working directory, still out of jail.
23 foo(); // expected-warning {{No call of chdir("/") immediately after chroot}}