xref: /llvm-project/clang/test/Modules/cxx20-no-check-input.cppm (revision 5b388f86aa9ce65778677ae56587867d6786355e)
1// RUN: rm -rf %t
2// RUN: split-file %s %t
3// RUN: cd %t
4//
5// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple \
6// RUN:     %t/a.cppm -emit-module-interface -o %t/a.pcm
7// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple \
8// RUN:     %t/use.cpp -fmodule-file=a=%t/a.pcm -verify -fsyntax-only
9// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple \
10// RUN:     %t/a.pcm -emit-llvm -o - | FileCheck %t/a.ll
11//
12// RUN: echo "//Update" >> %t/foo.h
13// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple \
14// RUN:     %t/use.cpp -fmodule-file=a=%t/a.pcm -verify -fsyntax-only
15// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple \
16// RUN:     %t/a.pcm -emit-llvm -o - | FileCheck %t/a.ll
17//
18// RUN: echo "//Update" >> %t/a.cppm
19// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple \
20// RUN:     %t/use.cpp -fmodule-file=a=%t/a.pcm -verify -fsyntax-only
21// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple \
22// RUN:     %t/a.pcm -emit-llvm -o - | FileCheck %t/a.ll
23//
24// RUN: rm -f %t/foo.h
25// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple \
26// RUN:     %t/use.cpp -fmodule-file=a=%t/a.pcm -verify -fsyntax-only
27// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple \
28// RUN:     %t/a.pcm -emit-llvm -o - | FileCheck %t/a.ll
29//
30// RUN: rm -f %t/a.cppm
31// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple \
32// RUN:     %t/use.cpp -fmodule-file=a=%t/a.pcm -verify -fsyntax-only
33// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple \
34// RUN:     %t/a.pcm -emit-llvm -o - | FileCheck %t/a.ll
35
36//--- foo.h
37inline int foo = 43;
38
39//--- a.cppm
40// expected-no-diagnostics
41module;
42#include "foo.h"
43export module a;
44export using ::foo;
45
46//--- a.ll
47// check the LLVM IR are generated succesfully.
48// CHECK: define{{.*}}@_ZGIW1a
49
50//--- use.cpp
51// expected-no-diagnostics
52import a;
53int use() {
54    return foo;
55}
56
57