brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · fab0b7d Raw
60 lines · plain
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4//5// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/Hello.cppm -o %t/Hello.pcm6// 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.cpp8// 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.cpp10//11// RUN: %clang_cc1 -std=c++20 -fopenmp -emit-module-interface %t/Hello.cppm -o %t/Hello.pcm12// RUN: %clang_cc1 -std=c++20 -fopenmp %t/use.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only -verify13// RUN: %clang_cc1 -std=c++20 -fopenmp %t/use2.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only -verify14 15// Test again with reduced BMI16// RUN: rm -rf %t17// RUN: mkdir -p %t18// RUN: split-file %s %t19//20// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/Hello.cppm -o %t/Hello.pcm21// RUN: not %clang_cc1 -std=c++20 -fopenmp %t/use.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only \22// RUN:     2>&1 | FileCheck %t/use.cpp23// RUN: not %clang_cc1 -std=c++20 -fopenmp %t/use2.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only \24// RUN:     2>&1 | FileCheck %t/use2.cpp25//26// RUN: %clang_cc1 -std=c++20 -fopenmp -emit-reduced-module-interface %t/Hello.cppm -o %t/Hello.pcm27// RUN: %clang_cc1 -std=c++20 -fopenmp %t/use.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only -verify28// RUN: %clang_cc1 -std=c++20 -fopenmp %t/use2.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only -verify29 30 31//--- Hello.cppm32export module hello;33export void hello() {34  35}36 37//--- use.cpp38// expected-no-diagnostics39import hello;40int use() {41  for(int i=0;i<10;i++)42    hello();43  return 0;44}45 46// CHECK: OpenMP{{.*}}differs in precompiled file '{{.*}}Hello.pcm' vs. current file47 48//--- use2.cpp49// expected-no-diagnostics50import hello;51int use2() {52#pragma omp parallel for53  for(int i=0;i<10;i++)54    hello();55  return 0;56}57 58// CHECK: OpenMP{{.*}}differs in precompiled file '{{.*}}Hello.pcm' vs. current file59// CHECK: use of undeclared identifier 'pragma'60