Richard Smith | 999500a | 2015-01-22 23:07:47 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
| 2 | // RUN: %clang_cc1 -fsyntax-only -DC1 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 3 | // RUN: %clang_cc1 -fsyntax-only -DC1 -I%S/Inputs/macro-reexport -fmodules -fimplicit-module-maps %s -fmodules-cache-path=%t -verify |
Richard Smith | 999500a | 2015-01-22 23:07:47 +0000 | [diff] [blame] | 4 | // RUN: %clang_cc1 -fsyntax-only -DD1 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 5 | // RUN: %clang_cc1 -fsyntax-only -DD1 -I%S/Inputs/macro-reexport -fmodules -fimplicit-module-maps %s -fmodules-cache-path=%t -verify |
Richard Smith | 999500a | 2015-01-22 23:07:47 +0000 | [diff] [blame] | 6 | // RUN: %clang_cc1 -fsyntax-only -DD2 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 7 | // RUN: %clang_cc1 -fsyntax-only -DD2 -I%S/Inputs/macro-reexport -fmodules -fimplicit-module-maps %s -fmodules-cache-path=%t -verify |
Richard Smith | 999500a | 2015-01-22 23:07:47 +0000 | [diff] [blame] | 8 | // RUN: %clang_cc1 -fsyntax-only -DF1 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 9 | // RUN: %clang_cc1 -fsyntax-only -DF1 -I%S/Inputs/macro-reexport -fmodules -fimplicit-module-maps %s -fmodules-cache-path=%t -verify |
Richard Smith | ee97793 | 2015-05-01 21:22:17 +0000 | [diff] [blame] | 10 | // |
| 11 | // RUN: %clang_cc1 -fmodules-local-submodule-visibility -fsyntax-only -DC1 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 12 | // RUN: %clang_cc1 -fmodules-local-submodule-visibility -fsyntax-only -DC1 -I%S/Inputs/macro-reexport -fmodules -fimplicit-module-maps %s -fmodules-cache-path=%t -verify |
Richard Smith | ee97793 | 2015-05-01 21:22:17 +0000 | [diff] [blame] | 13 | // RUN: %clang_cc1 -fmodules-local-submodule-visibility -fsyntax-only -DD1 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 14 | // RUN: %clang_cc1 -fmodules-local-submodule-visibility -fsyntax-only -DD1 -I%S/Inputs/macro-reexport -fmodules -fimplicit-module-maps %s -fmodules-cache-path=%t -verify |
Richard Smith | ee97793 | 2015-05-01 21:22:17 +0000 | [diff] [blame] | 15 | // RUN: %clang_cc1 -fmodules-local-submodule-visibility -fsyntax-only -DD2 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 16 | // RUN: %clang_cc1 -fmodules-local-submodule-visibility -fsyntax-only -DD2 -I%S/Inputs/macro-reexport -fmodules -fimplicit-module-maps %s -fmodules-cache-path=%t -verify |
Richard Smith | ee97793 | 2015-05-01 21:22:17 +0000 | [diff] [blame] | 17 | // RUN: %clang_cc1 -fmodules-local-submodule-visibility -fsyntax-only -DF1 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 18 | // RUN: %clang_cc1 -fmodules-local-submodule-visibility -fsyntax-only -DF1 -I%S/Inputs/macro-reexport -fmodules -fimplicit-module-maps %s -fmodules-cache-path=%t -verify |
Richard Smith | 999500a | 2015-01-22 23:07:47 +0000 | [diff] [blame] | 19 | |
| 20 | #if defined(F1) |
| 21 | #include "f1.h" |
| 22 | void f() { return assert(true); } // expected-error {{undeclared identifier 'd'}} |
| 23 | #include "e2.h" // undefines d1's macro |
| 24 | void g() { return assert(true); } // expected-error {{undeclared identifier 'assert'}} |
| 25 | #elif defined(D1) |
| 26 | #include "e1.h" // undefines c1's macro but not d1's macro |
| 27 | #include "d1.h" |
| 28 | void f() { return assert(true); } // expected-error {{undeclared identifier 'd'}} |
| 29 | #include "e2.h" // undefines d1's macro |
| 30 | void g() { return assert(true); } // expected-error {{undeclared identifier 'assert'}} |
| 31 | #elif defined(D2) |
| 32 | #include "d2.h" |
| 33 | void f() { return assert(true); } // expected-error {{undeclared identifier 'b'}} |
| 34 | #else |
| 35 | // e2 undefines d1's macro, which overrides c1's macro. |
| 36 | #include "e2.h" |
| 37 | #include "c1.h" |
| 38 | void f() { return assert(true); } // expected-error {{undeclared identifier 'assert'}} |
| 39 | #endif |