1*67e74705SXin Li // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=false -std=c++11 -verify %s 2*67e74705SXin Li // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,cplusplus.NewDelete,debug.ExprInspection -analyzer-config c++-container-inlining=true -analyzer-config c++-stdlib-inlining=true -std=c++11 -DINLINE=1 -verify %s 3*67e74705SXin Li 4*67e74705SXin Li #include "../Inputs/system-header-simulator-cxx.h" 5*67e74705SXin Li 6*67e74705SXin Li void clang_analyzer_eval(bool); 7*67e74705SXin Li testVector(std::vector<int> & nums)8*67e74705SXin Livoid testVector(std::vector<int> &nums) { 9*67e74705SXin Li if (nums.begin()) return; 10*67e74705SXin Li if (nums.end()) return; 11*67e74705SXin Li 12*67e74705SXin Li clang_analyzer_eval(nums.size() == 0); 13*67e74705SXin Li #if INLINE 14*67e74705SXin Li // expected-warning@-2 {{TRUE}} 15*67e74705SXin Li #else 16*67e74705SXin Li // expected-warning@-4 {{UNKNOWN}} 17*67e74705SXin Li #endif 18*67e74705SXin Li } 19*67e74705SXin Li testException(std::exception e)20*67e74705SXin Livoid testException(std::exception e) { 21*67e74705SXin Li // Notice that the argument is NOT passed by reference, so we can devirtualize. 22*67e74705SXin Li const char *x = e.what(); 23*67e74705SXin Li clang_analyzer_eval(x == 0); 24*67e74705SXin Li #if INLINE 25*67e74705SXin Li // expected-warning@-2 {{TRUE}} 26*67e74705SXin Li #else 27*67e74705SXin Li // expected-warning@-4 {{UNKNOWN}} 28*67e74705SXin Li #endif 29*67e74705SXin Li } 30