| 1 |
// Fixes #165445 |
| 2 |
|
| 3 |
// RUN: rm -rf %t |
| 4 |
// RUN: mkdir -p %t |
| 5 |
// RUN: split-file %s %t |
| 6 |
// |
| 7 |
// RUN: %clang_cc1 -std=c++20 -x c++-user-header %t/header.h \ |
| 8 |
// RUN: -emit-header-unit -o %t/header.pcm |
| 9 |
// |
| 10 |
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -fmodule-file=%t/header.pcm \ |
| 11 |
// RUN: -emit-module-interface -o %t/A.pcm |
| 12 |
// |
| 13 |
// RUN: %clang_cc1 -std=c++20 %t/B.cppm -fmodule-file=%t/header.pcm \ |
| 14 |
// RUN: -emit-module-interface -o %t/B.pcm |
| 15 |
// |
| 16 |
// RUN: %clang_cc1 -std=c++20 %t/use.cpp \ |
| 17 |
// RUN: -fmodule-file=A=%t/A.pcm -fmodule-file=B=%t/B.pcm \ |
| 18 |
// RUN: -fmodule-file=%t/header.pcm \ |
| 19 |
// RUN: -verify -fsyntax-only |
| 20 |
|
| 21 |
//--- enum.h |
| 22 |
enum E { Value }; |
| 23 |
|
| 24 |
//--- header.h |
| 25 |
#include "enum.h" |
| 26 |
|
| 27 |
//--- A.cppm |
| 28 |
module; |
| 29 |
#include "enum.h" |
| 30 |
export module A; |
| 31 |
|
| 32 |
auto e = Value; |
| 33 |
|
| 34 |
//--- B.cppm |
| 35 |
export module B; |
| 36 |
import "header.h"; |
| 37 |
|
| 38 |
auto e = Value; |
| 39 |
|
| 40 |
//--- use.cpp |
| 41 |
// expected-no-diagnostics |
| 42 |
import A; |
| 43 |
import B; |
| 44 |
#include "enum.h" |
| 45 |
|
| 46 |
auto e = Value; |