blob: 28206652b8ff081ea29e99692f461376cba1a795 [file] [log] [blame]
Richard Smith7a614d82011-06-11 17:19:42 +00001// Test this without pch.
Richard Smith762bb9d2011-10-13 22:29:44 +00002// RUN: %clang_cc1 -x c++ -std=c++11 -DHEADER -DSOURCE -fsyntax-only -emit-llvm -o - %s
Richard Smith7a614d82011-06-11 17:19:42 +00003
4// Test with pch.
Richard Smith762bb9d2011-10-13 22:29:44 +00005// 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
Richard Smith7a614d82011-06-11 17:19:42 +00007
8#ifdef HEADER
9int n;
10struct S {
11 int *p = &m;
12 int &m = n;
13 S *that = this;
14};
15#endif
16
17#ifdef SOURCE
18S s;
19#elif HEADER
20#undef HEADER
21#define SOURCE
22#endif