llvm-project/llvm/clang/test/Modules/implicit-opt-level.c
Jan Svoboda c592b61fc8
[clang][modules] Serialize CodeGenOptions (#146422)
Some `LangOptions` duplicate their `CodeGenOptions` counterparts. My
understanding is that this was done solely because some infrastructure
(like preprocessor initialization, serialization, module compatibility
checks, etc.) were only possible/convenient for `LangOptions`. This PR
implements the missing support for `CodeGenOptions`, which makes it
possible to remove some duplicate `LangOptions` fields and simplify the
logic. Motivated by https://github.com/llvm/llvm-project/pull/146342.
2025-07-15 12:45:09 -07:00

16 lines
507 B
C

// This test checks that under implicit modules, different optimization levels
// get different context hashes.
// RUN: rm -rf %t
// RUN: split-file %s %t
//--- module.modulemap
module M { header "M.h" }
//--- M.h
//--- tu.c
#include "M.h"
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -O0 -fsyntax-only %t/tu.c
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -O1 -fsyntax-only %t/tu.c
// RUN: find %t/cache -name "M-*.pcm" | count 2