3 // RUN: split-file %s %t
5 // RUN: %clang_cc1 -std=c++20 %t/lambdas.cppm -emit-module-interface \
6 // RUN: -o %t/lambdas.pcm
7 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only \
10 // RUN: %clang_cc1 -std=c++20 %t/lambdas2.cppm -emit-module-interface \
11 // RUN: -o %t/lambdas2.pcm
12 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only \
13 // RUN: -verify -DUSE_LAMBDA2
16 auto l1 = []() constexpr -> int {
20 auto l2 = []() constexpr -> double {
24 auto l3 = [](auto i) constexpr -> int {
28 auto l4 = [](auto i, auto u) constexpr -> int {
35 export module lambdas;
42 export module lambdas2;
48 // expected-no-diagnostics
55 static_assert(l1.operator()() == 43);
57 static_assert(l2.operator()() == 3.0);
59 static_assert(l3.operator()(8.4) == 8);
61 static_assert(l4(4, 12) == 16);
62 static_assert(l4(5, 20) == 25);