llvm-project/clang/test/Modules/load-module-with-errors.m
Ben Barham 5834996fef [Frontend] Add flag to allow PCM generation despite compiler errors
As with precompiled headers, it's useful for indexers to be able to
continue through compiler errors in dependent modules.

Resolves rdar://69816264

Reviewed By: akyrtzi

Differential Revision: https://reviews.llvm.org/D91580
2020-11-17 17:27:50 -08:00

26 lines
801 B
Objective-C

// RUN: rm -rf %t
// RUN: mkdir %t
// Write out a module with errors make sure it can be read
// RUN: %clang_cc1 -fmodules -fallow-pcm-with-compiler-errors \
// RUN: -fmodules-cache-path=%t -x objective-c -emit-module \
// RUN: -fmodule-name=error %S/Inputs/module.map
// RUN: %clang_cc1 -fmodules -fallow-pcm-with-compiler-errors \
// RUN: -fmodules-cache-path=%t -x objective-c -I %S/Inputs \
// RUN: -fimplicit-module-maps -ast-print %s | FileCheck %s
// allow-pcm-with-compiler-errors should also allow errors in PCH
// RUN: %clang_cc1 -fallow-pcm-with-compiler-errors -x c++ -emit-pch \
// RUN: -o %t/check.pch %S/Inputs/error.h
@import error;
void test(id x) {
[x method];
}
// CHECK: @interface Error
// CHECK-NEXT: - (int)method;
// CHECK-NEXT: @end
// CHECK: void test(id x)