xref: /aosp_15_r20/external/clang/test/Modules/module-feature.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: rm -rf %t %t.nohash
2*67e74705SXin Li
3*67e74705SXin Li// Each set of features gets its own cache.
4*67e74705SXin Li// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -fmodule-feature f1 -fmodule-feature f2 -F %S/Inputs %s -verify -Rmodule-build
5*67e74705SXin Li// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -fmodule-feature f2 -F %S/Inputs %s -verify -Rmodule-build
6*67e74705SXin Li// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -fmodule-feature f2 -fmodule-feature f1 -F %S/Inputs %s -Rmodule-build 2>&1 | FileCheck %s -allow-empty -check-prefix=ALREADY_BUILT
7*67e74705SXin Li// ALREADY_BUILT-NOT: building module
8*67e74705SXin Li
9*67e74705SXin Li// Errors if we try to force the load.
10*67e74705SXin Li// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t.nohash -fimplicit-module-maps -fdisable-module-hash -fmodule-feature f1 -fmodule-feature f2 -F %S/Inputs %s -verify -Rmodule-build
11*67e74705SXin Li// RUN: not %clang_cc1 -fmodules -fmodules-cache-path=%t.nohash -fimplicit-module-maps -fdisable-module-hash -fmodule-feature f2 -F %S/Inputs %s 2>&1 | FileCheck %s -check-prefix=DIFFERS
12*67e74705SXin Li// DIFFERS: error: module features differs
13*67e74705SXin Li
14*67e74705SXin Li@import Module; // expected-remark {{building module 'Module'}} expected-remark {{finished}}
15