aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Modules/named-module-with-fmodules.cppm
blob: 5fab9f3c75ea19473914aa601e682b76afd5475d (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
// Checks that Clang modules can be imported from within the global module 
// fragment of a named module interface unit.
// Fixes #159768.

// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t

// RUN: %clang -std=c++23 -fmodules -fmodule-map-file=%t/module.modulemap \
// RUN:   -fmodules-cache-path=%t --precompile %t/A.cppm -o %t/A.pcm

//--- module.modulemap
module foo { header "foo.h" }

//--- foo.h
// empty

//--- A.cppm
module;
#include "foo.h"
export module A;

export auto A() -> int { return 42; }