1 // Reduced from https://github.com/llvm/llvm-project/issues/93859
5 // RUN: split-file %s %t
7 // RUN: %clang_cc1 -std=c++20 %t/reduced_std.cppm -emit-reduced-module-interface -o %t/reduced_std.pcm
8 // RUN: %clang_cc1 -std=c++20 %t/Misc.cppm -emit-reduced-module-interface -o %t/Misc.pcm \
9 // RUN: -fprebuilt-module-path=%t
10 // RUN: %clang_cc1 -std=c++20 %t/Instance.cppm -emit-reduced-module-interface -o %t/Instance.pcm \
11 // RUN: -fprebuilt-module-path=%t
12 // RUN: %clang_cc1 -std=c++20 %t/Device.cppm -emit-reduced-module-interface -o %t/Device.pcm \
13 // RUN: -fprebuilt-module-path=%t
14 // RUN: %clang_cc1 -std=c++20 %t/Overlay.cppm -emit-reduced-module-interface -o %t/Overlay.pcm \
15 // RUN: -fprebuilt-module-path=%t
16 // RUN: %clang_cc1 -std=c++20 %t/App.cppm -emit-module-interface -o /dev/null \
17 // RUN: -fexperimental-modules-reduced-bmi -fmodule-output=%t/App.pcm \
18 // RUN: -fprebuilt-module-path=%t
19 // RUN: %clang_cc1 -std=c++20 %t/test.cc -fsyntax-only -verify \
20 // RUN: -fprebuilt-module-path=%t
25 template <class _T1, class _T2>
32 : first(), second() {}
34 constexpr pair(_T1 const& __t1, _T2 const& __t2)
35 : first(__t1), second(__t2) {}
38 template <class _T1, class _T2>
39 pair(_T1, _T2) -> pair<_T1, _T2>;
42 class __tree_const_iterator {
51 typedef _Tp value_type;
52 typedef __tree_const_iterator<value_type> const_iterator;
54 template <class, class, class, class>
61 typedef __tree<_Key> __base;
63 typedef typename __base::const_iterator iterator;
68 insert(const _Key& __v);
71 template <class _InputIterator, class _OutputIterator>
72 inline constexpr _OutputIterator
73 copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) {
74 return pair{__first, __last}.second;
79 //--- reduced_std.cppm
82 export module reduced_std;
84 export namespace std {
93 export void check_result(int res) {
94 std::set<char> extensions;
95 extensions.insert('f');
99 export module Instance;
102 export class Instance {
105 std::set<const char*> extensions;
106 extensions.insert("foo");
111 export module Device;
116 std::set<int> wtf_set;
119 export module Overlay;
124 void overlay_vector_use() {
138 // expected-no-diagnostics
143 unsigned *oidxs = nullptr;
144 unsigned idxs[] = {0, 1, 2, 0, 2, 3};
145 std::copy(idxs, idxs + 6, oidxs);