3 // RUN: split-file %s %t
5 // RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm
6 // RUN: %clang_cc1 -std=c++20 %t/use.cc -fmodule-file=a=%t/a.pcm -fsyntax-only -verify
7 // RUN: %clang_cc1 -std=c++20 %t/a-part.cppm -fmodule-file=a=%t/a.pcm -fsyntax-only -verify
9 // Test again with reduced BMI
10 // RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
11 // RUN: %clang_cc1 -std=c++20 %t/use.cc -fmodule-file=a=%t/a.pcm -fsyntax-only -verify
12 // RUN: %clang_cc1 -std=c++20 %t/a-part.cppm -fmodule-file=a=%t/a.pcm -fsyntax-only -verify
13 // RUN: %clang_cc1 -std=c++20 %t/a.cc -fmodule-file=a=%t/a.pcm -fsyntax-only -verify
21 export constexpr int f() { return x; }
23 export template <typename T>
32 export constexpr int f() { return x; }
34 export template <typename T>
41 // expected-no-diagnostics
44 static_assert(f() == 43, "");
48 static_assert(g<int>() == 43, "");
50 static_assert(x == 99, "");
53 static_assert(f() == 88, "");
55 constexpr int x = 1000;
57 static_assert(g<int>() == 88, "");
59 static_assert(x == 1000, "");
67 static_assert(x == 43, "");
69 constexpr int x = 1000; // expected-error {{redefinition of 'x'}}
70 // expected-note@* {{previous definition is here}}
75 static_assert(x == 43, "");
77 constexpr int x = 1000; // expected-error {{redefinition of 'x'}}
78 // expected-note@* {{previous definition is here}}