Sebastian Redl | 7c0837f | 2011-04-24 16:28:13 +0000 | [diff] [blame] | 1 | // no PCH |
| 2 | // RUN: %clang_cc1 -include %s -include %s -fsyntax-only %s |
| 3 | // with PCH |
| 4 | // RUN: %clang_cc1 -chain-include %s -chain-include %s -fsyntax-only %s |
Richard Smith | d613ac9 | 2013-04-04 01:51:11 +0000 | [diff] [blame] | 5 | // with PCH, with modules enabled |
| 6 | // RUN: %clang_cc1 -chain-include %s -chain-include %s -fsyntax-only -fmodules %s |
Sebastian Redl | 7c0837f | 2011-04-24 16:28:13 +0000 | [diff] [blame] | 7 | #if !defined(PASS1) |
| 8 | #define PASS1 |
| 9 | |
| 10 | namespace ns {} |
Sebastian Redl | 74b485a | 2011-04-24 16:28:21 +0000 | [diff] [blame] | 11 | namespace os {} |
Sebastian Redl | 7c0837f | 2011-04-24 16:28:13 +0000 | [diff] [blame] | 12 | |
| 13 | #elif !defined(PASS2) |
| 14 | #define PASS2 |
| 15 | |
| 16 | namespace ns { |
| 17 | namespace { |
| 18 | extern int x; |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | namespace { |
| 23 | extern int y; |
| 24 | } |
Sebastian Redl | 74b485a | 2011-04-24 16:28:21 +0000 | [diff] [blame] | 25 | namespace { |
| 26 | } |
| 27 | |
| 28 | namespace os { |
| 29 | extern "C" { |
| 30 | namespace { |
| 31 | extern int z; |
| 32 | } |
| 33 | } |
| 34 | } |
Sebastian Redl | 7c0837f | 2011-04-24 16:28:13 +0000 | [diff] [blame] | 35 | |
| 36 | #else |
| 37 | |
| 38 | namespace ns { |
| 39 | namespace { |
| 40 | int x; |
| 41 | } |
| 42 | void test() { |
| 43 | (void)x; |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | namespace { |
| 48 | int y; |
| 49 | } |
| 50 | void test() { |
| 51 | (void)y; |
| 52 | } |
| 53 | |
Sebastian Redl | 74b485a | 2011-04-24 16:28:21 +0000 | [diff] [blame] | 54 | namespace os { |
| 55 | namespace { |
| 56 | int z; |
| 57 | } |
| 58 | void test() { |
| 59 | (void)z; |
| 60 | } |
| 61 | } |
| 62 | |
Sebastian Redl | 7c0837f | 2011-04-24 16:28:13 +0000 | [diff] [blame] | 63 | #endif |