2011-06-12 01:19:42 +08:00
|
|
|
// Test this without pch.
|
2011-10-14 06:29:44 +08:00
|
|
|
// RUN: %clang_cc1 -x c++ -std=c++11 -DHEADER -DSOURCE -fsyntax-only -emit-llvm -o - %s
|
2011-06-12 01:19:42 +08:00
|
|
|
|
|
|
|
// Test with pch.
|
2011-10-14 06:29:44 +08:00
|
|
|
// RUN: %clang_cc1 -x c++ -std=c++11 -DHEADER -emit-pch -o %t %s
|
|
|
|
// RUN: %clang_cc1 -x c++ -std=c++11 -DHEADER -include-pch %t -fsyntax-only -emit-llvm -o - %s
|
2011-06-12 01:19:42 +08:00
|
|
|
|
|
|
|
#ifdef HEADER
|
|
|
|
int n;
|
|
|
|
struct S {
|
|
|
|
int *p = &m;
|
|
|
|
int &m = n;
|
|
|
|
S *that = this;
|
|
|
|
};
|
2012-06-10 11:12:00 +08:00
|
|
|
template<typename T> struct X { T t {0}; };
|
2011-06-12 01:19:42 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef SOURCE
|
|
|
|
S s;
|
2012-06-10 11:12:00 +08:00
|
|
|
|
|
|
|
struct E { explicit E(int); };
|
|
|
|
X<E> x;
|
2011-06-12 01:19:42 +08:00
|
|
|
#elif HEADER
|
|
|
|
#undef HEADER
|
|
|
|
#define SOURCE
|
|
|
|
#endif
|