Richard Smith | 7a614d8 | 2011-06-11 17:19:42 +0000 | [diff] [blame^] | 1 | // Test this without pch. |
2 | // RUN: %clang_cc1 -x c++ -std=c++0x -DHEADER -DSOURCE -fsyntax-only -emit-llvm -o - %s | ||||
3 | |||||
4 | // Test with pch. | ||||
5 | // RUN: %clang_cc1 -x c++ -std=c++0x -DHEADER -emit-pch -o %t %s | ||||
6 | // RUN: %clang_cc1 -x c++ -std=c++0x -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 | #endif | ||||
16 | |||||
17 | #ifdef SOURCE | ||||
18 | S s; | ||||
19 | #elif HEADER | ||||
20 | #undef HEADER | ||||
21 | #define SOURCE | ||||
22 | #endif |