Richard Smith | 7a614d8 | 2011-06-11 17:19:42 +0000 | [diff] [blame] | 1 | // Test this without pch. |
Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -x c++ -std=c++11 -DHEADER -DSOURCE -fsyntax-only -emit-llvm -o - %s |
Richard Smith | 7a614d8 | 2011-06-11 17:19:42 +0000 | [diff] [blame] | 3 | |
| 4 | // Test with pch. |
Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 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 |
Richard Smith | 7a614d8 | 2011-06-11 17:19:42 +0000 | [diff] [blame] | 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 |