blob: edae285c9084eeff0d0a63f6d0ae8c289fccf366 [file] [log] [blame]
Sebastian Redl7c0837f2011-04-24 16:28:13 +00001// 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 Smithd613ac92013-04-04 01:51:11 +00005// with PCH, with modules enabled
6// RUN: %clang_cc1 -chain-include %s -chain-include %s -fsyntax-only -fmodules %s
Sebastian Redl7c0837f2011-04-24 16:28:13 +00007#if !defined(PASS1)
8#define PASS1
9
10namespace ns {}
Sebastian Redl74b485a2011-04-24 16:28:21 +000011namespace os {}
Sebastian Redl7c0837f2011-04-24 16:28:13 +000012
13#elif !defined(PASS2)
14#define PASS2
15
16namespace ns {
17 namespace {
18 extern int x;
19 }
20}
21
22namespace {
23 extern int y;
24}
Sebastian Redl74b485a2011-04-24 16:28:21 +000025namespace {
26}
27
28namespace os {
29 extern "C" {
30 namespace {
31 extern int z;
32 }
33 }
34}
Sebastian Redl7c0837f2011-04-24 16:28:13 +000035
36#else
37
38namespace ns {
39 namespace {
40 int x;
41 }
42 void test() {
43 (void)x;
44 }
45}
46
47namespace {
48 int y;
49}
50void test() {
51 (void)y;
52}
53
Sebastian Redl74b485a2011-04-24 16:28:21 +000054namespace os {
55 namespace {
56 int z;
57 }
58 void test() {
59 (void)z;
60 }
61}
62
Sebastian Redl7c0837f2011-04-24 16:28:13 +000063#endif