brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.2 KiB · 60a7b10 Raw
75 lines · plain
1// This test is for cases where we lookup a file by its 'real' path before we2// use its VFS-mapped path. If we accidentally use the real path in header3// search, we will not find a module for the headers.  To test that we4// intentionally rebuild modules, since the precompiled module file refers to5// the dependency files by real path.6 7// RUN: rm -rf %t %t-cache %t.pch8// RUN: mkdir -p %t/SomeFramework.framework/Modules9// RUN: cat %S/Inputs/some_frame_module.map > %t/SomeFramework.framework/Modules/module.modulemap10// RUN: sed -e "s@INPUT_DIR@%{/S:regex_replacement}/Inputs@g" -e "s@OUT_DIR@%{/t:regex_replacement}@g" %S/Inputs/vfsoverlay.yaml > %t.yaml11 12// Build13// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \14// RUN:     -ivfsoverlay %t.yaml -fsyntax-only %s -verify -Rmodule-include-translation \15// RUN:     -Werror=non-modular-include-in-framework-module16 17// Rebuild18// RUN: echo ' ' >> %t/SomeFramework.framework/Modules/module.modulemap19// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \20// RUN:     -ivfsoverlay %t.yaml -fsyntax-only %s -verify -Rmodule-include-translation \21// RUN:     -Werror=non-modular-include-in-framework-module22 23// Load from PCH24// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \25// RUN:     -ivfsoverlay %t.yaml -emit-pch  %s -o %t.pch \26// RUN:     -Werror=non-modular-include-in-framework-module \27// RUN:     -fmodules-ignore-macro=WITH_PREFIX28// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \29// RUN:     -ivfsoverlay %t.yaml -include-pch %t.pch -fsyntax-only  %s \30// RUN:     -Werror=non-modular-include-in-framework-module -DWITH_PREFIX \31// RUN:     -fmodules-ignore-macro=WITH_PREFIX32 33// While indexing34// RUN: c-index-test -index-file %s -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \35// RUN:     -ivfsoverlay %t.yaml -fsyntax-only -Rmodule-include-translation \36// RUN:     -Werror=non-modular-include-in-framework-module | FileCheck %s37// RUN: echo ' ' >> %t/SomeFramework.framework/Modules/module.modulemap38// RUN: c-index-test -index-file %s -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \39// RUN:     -ivfsoverlay %t.yaml -fsyntax-only -Rmodule-include-translation \40// RUN:     -Werror=non-modular-include-in-framework-module | FileCheck %s41// CHECK: warning: treating42// CHECK-NOT: error:43 44// With a VFS-mapped module map file45// RUN: mv %t/SomeFramework.framework/Modules/module.modulemap %t/hide_module.map46// RUN: echo "{ 'version': 0, 'roots': [ { " > %t2.yaml47// RUN: echo "'name': '%t/SomeFramework.framework/Modules/module.modulemap'," >> %t2.yaml48// RUN: echo "'type': 'file', 'external-contents': '%t/hide_module.map' } ] }" >> %t2.yaml49 50// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \51// RUN:     -ivfsoverlay %t.yaml -ivfsoverlay %t2.yaml -fsyntax-only %s -verify \52// RUN:     -Rmodule-include-translation -Werror=non-modular-include-in-framework-module53// RUN: echo ' ' >> %t/hide_module.map54// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \55// RUN:     -ivfsoverlay %t.yaml -ivfsoverlay %t2.yaml -fsyntax-only %s -verify \56// RUN:     -Rmodule-include-translation -Werror=non-modular-include-in-framework-module57 58// Within a module build59// RUN: echo '@import import_some_frame;' | \60// RUN:   %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \61// RUN:      -ivfsoverlay %t.yaml -ivfsoverlay %t2.yaml -fsyntax-only - \62// RUN:      -Werror=non-modular-include-in-framework-module -x objective-c -I %t63// RUN: echo ' ' >> %t/hide_module.map64// RUN: echo '@import import_some_frame;' | \65// RUN:   %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t-cache -F %t \66// RUN:      -ivfsoverlay %t.yaml -ivfsoverlay %t2.yaml -fsyntax-only - \67// RUN:      -Werror=non-modular-include-in-framework-module -x objective-c -I %t68 69#ifndef WITH_PREFIX70#import <SomeFramework/public_header.h> // expected-remark{{treating}}71#import <SomeFramework/public_header2.h> // expected-remark{{treating}}72#import <SomeFramework/public_header3.h> // expected-remark{{treating}}73@import SomeFramework.public_header2;74#endif75