252
|
1 // RUN: rm -rf %t
|
|
2 // RUN: mkdir -p %t
|
|
3 // RUN: split-file %s %t
|
|
4 //
|
|
5 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/Hello.cppm -o %t/Hello.pcm
|
|
6 // RUN: not %clang_cc1 -std=c++20 -fopenmp %t/use.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only \
|
|
7 // RUN: 2>&1 | FileCheck %t/use.cpp
|
|
8 // RUN: not %clang_cc1 -std=c++20 -fopenmp %t/use2.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only \
|
|
9 // RUN: 2>&1 | FileCheck %t/use2.cpp
|
|
10 //
|
|
11 // RUN: %clang_cc1 -std=c++20 -fopenmp -emit-module-interface %t/Hello.cppm -o %t/Hello.pcm
|
|
12 // RUN: %clang_cc1 -std=c++20 -fopenmp %t/use.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only -verify
|
|
13 // RUN: %clang_cc1 -std=c++20 -fopenmp %t/use2.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only -verify
|
|
14
|
|
15 //--- Hello.cppm
|
|
16 export module hello;
|
|
17 export void hello() {
|
|
18
|
|
19 }
|
|
20
|
|
21 //--- use.cpp
|
|
22 // expected-no-diagnostics
|
|
23 import hello;
|
|
24 int use() {
|
|
25 for(int i=0;i<10;i++)
|
|
26 hello();
|
|
27 return 0;
|
|
28 }
|
|
29
|
|
30 // CHECK: OpenMP{{.*}}differs in PCH file vs. current file
|
|
31
|
|
32 //--- use2.cpp
|
|
33 // expected-no-diagnostics
|
|
34 import hello;
|
|
35 int use2() {
|
|
36 #pragma omp parallel for
|
|
37 for(int i=0;i<10;i++)
|
|
38 hello();
|
|
39 return 0;
|
|
40 }
|
|
41
|
|
42 // CHECK: OpenMP{{.*}}differs in PCH file vs. current file
|
|
43 // CHECK: use of undeclared identifier 'pragma'
|