xref: /aosp_15_r20/external/clang/test/Modules/load_failure.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li #ifdef NONEXISTENT
2*67e74705SXin Li @import load_nonexistent;
3*67e74705SXin Li #endif
4*67e74705SXin Li 
5*67e74705SXin Li #ifdef FAILURE
6*67e74705SXin Li @import load_failure;
7*67e74705SXin Li #endif
8*67e74705SXin Li 
9*67e74705SXin Li // RUN: rm -rf %t
10*67e74705SXin Li // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c++ -fmodules-cache-path=%t -fdisable-module-hash -emit-module -fmodule-name=load_failure %S/Inputs/module.map
11*67e74705SXin Li // RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -I %S/Inputs -fdisable-module-hash %s -DNONEXISTENT 2>&1 | FileCheck -check-prefix=CHECK-NONEXISTENT %s
12*67e74705SXin Li // CHECK-NONEXISTENT: load_failure.c:2:9: fatal error: module 'load_nonexistent' not found
13*67e74705SXin Li 
14*67e74705SXin Li // RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -I %S/Inputs -fdisable-module-hash %s -DFAILURE 2> %t.out
15*67e74705SXin Li // RUN: FileCheck -check-prefix=CHECK-FAILURE %s < %t.out
16*67e74705SXin Li 
17*67e74705SXin Li // FIXME: Clean up diagnostic text below and give it a location
18*67e74705SXin Li // CHECK-FAILURE: error: C99 was disabled in PCH file but is currently enabled
19*67e74705SXin Li // FIXME: When we have a syntax for modules in C, use that.
20*67e74705SXin Li 
21*67e74705SXin Li 
22