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