diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2012-09-12 01:11:10 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2012-09-12 01:11:10 +0000 |
| commit | 66a34a6a45019a54d84e9c5a06c4498e56f13a40 (patch) | |
| tree | 6266063bb26f81c7dc56d82c0d733d3c13a19c94 /clang/test/Analysis/Inputs/system-header-simulator-cxx.h | |
| parent | 575037f0deb35858ed8b248ba67aa2418ba8b4ec (diff) | |
| download | bcm5719-llvm-66a34a6a45019a54d84e9c5a06c4498e56f13a40.tar.gz bcm5719-llvm-66a34a6a45019a54d84e9c5a06c4498e56f13a40.zip | |
Adjust some analyzer tests to place widely shared inputs inside of an
'Inputs' subdirectory.
The general desire has been to have essentially all of the non-test
input files live in such directories, with some exceptions for obvious
and common patterns like 'foo.c' using 'foo.h'.
This came up because our distributed test runner couldn't find some of
the headers, for example with stl.cpp.
No functionality changed, just shuffling around here.
llvm-svn: 163674
Diffstat (limited to 'clang/test/Analysis/Inputs/system-header-simulator-cxx.h')
| -rw-r--r-- | clang/test/Analysis/Inputs/system-header-simulator-cxx.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/clang/test/Analysis/Inputs/system-header-simulator-cxx.h b/clang/test/Analysis/Inputs/system-header-simulator-cxx.h new file mode 100644 index 00000000000..e762d0a1bdf --- /dev/null +++ b/clang/test/Analysis/Inputs/system-header-simulator-cxx.h @@ -0,0 +1,57 @@ +#pragma clang system_header + +namespace std { + template <class T1, class T2> + struct pair { + T1 first; + T2 second; + + pair() : first(), second() {} + pair(const T1 &a, const T2 &b) : first(a), second(b) {} + + template<class U1, class U2> + pair(const pair<U1, U2> &other) : first(other.first), second(other.second) {} + }; + + typedef __typeof__(sizeof(int)) size_t; + + template<typename T> + class vector { + T *_start; + T *_finish; + T *_end_of_storage; + public: + vector() : _start(0), _finish(0), _end_of_storage(0) {} + ~vector(); + + size_t size() const { + return size_t(_finish - _start); + } + + void push_back(); + T pop_back(); + + T &operator[](size_t n) { + return _start[n]; + } + + const T &operator[](size_t n) const { + return _start[n]; + } + + T *begin() { return _start; } + const T *begin() const { return _start; } + + T *end() { return _finish; } + const T *end() const { return _finish; } + }; + + class exception { + public: + exception() throw(); + virtual ~exception() throw(); + virtual const char *what() const throw() { + return 0; + } + }; +} |

