34 lines · plain
1// RUN: rm -rf %t2// RUN: split-file %s %t3//4// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple \5// RUN: -fforce-check-cxx20-modules-input-files \6// RUN: %t/a.cppm -emit-module-interface -o %t/a.pcm7//8// RUN: echo "inline int bar = 46;" >> %t/foo.h9// RUN: not %clang_cc1 -std=c++20 -triple %itanium_abi_triple \10// RUN: -fforce-check-cxx20-modules-input-files %t/a.pcm \11// RUN: -emit-llvm -o - 2>&1 | FileCheck %t/a.cppm -check-prefix=CHECK-HEADER-FAILURE12// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple \13// RUN: -fforce-check-cxx20-modules-input-files \14// RUN: %t/a.cppm -emit-module-interface -o %t/a.pcm15 16// RUN: echo "export int var = 43;" >> %t/a.cppm17//18// RUN: not %clang_cc1 -std=c++20 -triple %itanium_abi_triple \19// RUN: -fforce-check-cxx20-modules-input-files %t/a.pcm \20// RUN: -emit-llvm -o - 2>&1 | FileCheck %t/a.cppm -check-prefix=CHECK-FAILURE21 22//--- foo.h23inline int foo = 43;24 25//--- a.cppm26// expected-no-diagnostics27module;28#include "foo.h"29export module a;30export using ::foo;31 32// CHECK-HEADER-FAILURE: fatal error:{{.*}}foo.h' has been modified since the precompiled file {{.*}}was built33// CHECK-FAILURE: fatal error:{{.*}}a.cppm' has been modified since the precompiled file {{.*}}was built34