brintos

brintos / llvm-project-archived public Read only

0
0
Text · 792 B · 52ea7bb Raw
44 lines · cpp
1// Test this without pch.2// RUN: %clang_cc1 -x c++ -std=c++11 -DHEADER -DSOURCE -emit-llvm -o - %s3 4// Test with pch.5// RUN: %clang_cc1 -x c++ -std=c++11 -DHEADER -emit-pch -o %t %s6// RUN: %clang_cc1 -x c++ -std=c++11 -DHEADER -include-pch %t -emit-llvm -o - %s 7 8// RUN: %clang_cc1 -x c++ -std=c++11 -DHEADER -emit-pch -fpch-instantiate-templates -o %t %s9// RUN: %clang_cc1 -x c++ -std=c++11 -DHEADER -include-pch %t -emit-llvm -o - %s10 11#ifdef HEADER12int n;13struct S {14  int *p = &m;15  int &m = n;16  S *that = this;17};18template<typename T> struct X { T t {0}; };19 20struct v_t { };21 22struct m_t23{24    struct { v_t v; };25    m_t() { }26};27 28#endif29 30#ifdef SOURCE31S s;32 33struct E { explicit E(int); };34X<E> x;35 36m_t *test() {37  return new m_t;38}39 40#elif HEADER41#undef HEADER42#define SOURCE43#endif44