aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Modules/pr140130.cpp
blob: da26a005b04f874eca5f988899a80a70c90fc2fd (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: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
// RUN: cd %t
// RUN: %clang_cc1 -iquote . -fmodules -fno-cxx-modules -emit-module \
// RUN:   -std=c++20 -fmodule-name=c -xc++ c.cppmap -o c.pcm
// RUN: %clang_cc1 -iquote . -fmodules -fno-cxx-modules -emit-module \
// RUN:   -std=c++20 -fmodule-name=a -fmodule-map-file=a.cppmap \
// RUN:   -fmodule-file=c.pcm -xc++ a.cppmap -o a.pcm

//--- a.cppmap
module "a" {
 header "a.h"
}
//--- a.h
#include "b.h"
//--- b.h
#ifndef _B_H_
#define _B_H_
struct B {
  consteval B() {}
  union {
    int a;
  };
};
constexpr B b;
#endif
//--- c.cppmap
module "c" {
header "c.h"
}
//--- c.h
#include "b.h"