| 1 |
// RUN: split-file %s %t |
| 2 |
|
| 3 |
// There are two requirements here to result in the owner of a macro being null. |
| 4 |
// 1) There must be a configuration mismatch between a header and a file it depends on |
| 5 |
// 2) -fmodules-local-submodule-visibility must be enabled. |
| 6 |
|
| 7 |
// In the following example, when compiling module C, A_H has no owning module. |
| 8 |
|
| 9 |
// RUN: %clang_cc1 -I%t -emit-module -o %t/a.pcm -fmodules %t/module.modulemap -fmodule-name=a -fmodules-local-submodule-visibility |
| 10 |
// RUN: %clang_cc1 -fexceptions -Wno-module-file-config-mismatch -I%t -emit-module -o %t/b.pcm -fmodules %t/module.modulemap -fmodule-name=b -fmodules-local-submodule-visibility -fmodule-file=%t/a.pcm |
| 11 |
// RUN: %clang_cc1 -fexceptions -Wno-module-file-config-mismatch -I%t -emit-module -o %t/c.pcm -fmodules %t/module.modulemap -fmodule-name=c -fmodules-local-submodule-visibility -fmodule-file=%t/a.pcm -fmodule-file=%t/b.pcm |
| 12 |
|
| 13 |
//--- module.modulemap |
| 14 |
module a { header "a.h" } |
| 15 |
module b { header "b.h" } |
| 16 |
module c { header "c.h" } |
| 17 |
|
| 18 |
//--- a.h |
| 19 |
#ifndef A_H |
| 20 |
#define A_H |
| 21 |
#endif |
| 22 |
|
| 23 |
//--- b.h |
| 24 |
#ifndef B_H |
| 25 |
#define B_H |
| 26 |
|
| 27 |
#include <a.h> |
| 28 |
|
| 29 |
#endif |
| 30 |
|
| 31 |
//--- c.h |
| 32 |
#include <a.h> |
| 33 |
#include <b.h> |