
Fixes #132692. `clang -cc1` crashes when generating a module interface with `emit-module-interface` or `emit-reduced-module-interface` using an input file which is already a precompiled module (`.pcm`) file. This commit adds validation for the input file format and Clang will now emit an error message instead of crashing.
14 lines
449 B
C++
14 lines
449 B
C++
// RUN: rm -rf %t
|
|
// RUN: split-file %s %t
|
|
// RUN: cd %t
|
|
|
|
// Related to issue #132692
|
|
// Verify that clang_cc1 doesn't crash when trying to generate a module
|
|
// interface from an alreay precompiled module (`.pcm`).
|
|
// RUN: %clang_cc1 -std=c++20 -emit-module-interface a.cppm -o a.pcm
|
|
// RUN: not %clang_cc1 -std=c++20 -emit-module-interface a.pcm
|
|
// RUN: not %clang_cc1 -std=c++20 -emit-reduced-module-interface a.pcm
|
|
|
|
//--- a.cppm
|
|
export module A;
|