1 // Test this without pch. 2 // RUN: %clang_cc1 -x c++ -std=c++11 -DHEADER -DSOURCE -fsyntax-only -emit-llvm -o - %s 3 4 // Test with pch. 5 // RUN: %clang_cc1 -x c++ -std=c++11 -DHEADER -emit-pch -o %t %s 6 // RUN: %clang_cc1 -x c++ -std=c++11 -DHEADER -include-pch %t -fsyntax-only -emit-llvm -o - %s 7 8 #ifdef HEADER 9 int n; 10 struct S { 11 int *p = &m; 12 int &m = n; 13 S *that = this; 14 }; 15 template<typename T> struct X { T t {0}; }; 16 17 struct v_t { }; 18 19 struct m_t 20 { 21 struct { v_t v; }; m_tm_t22 m_t() { } 23 }; 24 25 #endif 26 27 #ifdef SOURCE 28 S s; 29 30 struct E { explicit E(int); }; 31 X<E> x; 32 test()33m_t *test() { 34 return new m_t; 35 } 36 37 #elif HEADER 38 #undef HEADER 39 #define SOURCE 40 #endif 41