| 1 |
// RUN: rm -rf %t |
| 2 |
// RUN: mkdir -p %t |
| 3 |
// RUN: split-file %s %t |
| 4 |
// RUN: cd %t |
| 5 |
// RUN: %clang_cc1 -iquote . -fmodules -fno-cxx-modules -emit-module \ |
| 6 |
// RUN: -std=c++20 -fmodule-name=c -xc++ c.cppmap -o c.pcm |
| 7 |
// RUN: %clang_cc1 -iquote . -fmodules -fno-cxx-modules -emit-module \ |
| 8 |
// RUN: -std=c++20 -fmodule-name=a -fmodule-map-file=a.cppmap \ |
| 9 |
// RUN: -fmodule-file=c.pcm -xc++ a.cppmap -o a.pcm |
| 10 |
|
| 11 |
//--- a.cppmap |
| 12 |
module "a" { |
| 13 |
header "a.h" |
| 14 |
} |
| 15 |
//--- a.h |
| 16 |
#include "b.h" |
| 17 |
//--- b.h |
| 18 |
#ifndef _B_H_ |
| 19 |
#define _B_H_ |
| 20 |
struct B { |
| 21 |
consteval B() {} |
| 22 |
union { |
| 23 |
int a; |
| 24 |
}; |
| 25 |
}; |
| 26 |
constexpr B b; |
| 27 |
#endif |
| 28 |
//--- c.cppmap |
| 29 |
module "c" { |
| 30 |
header "c.h" |
| 31 |
} |
| 32 |
//--- c.h |
| 33 |
#include "b.h" |