xref: /llvm-project/clang/test/Modules/dependent-module-different-location.m (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1// RUN: rm -rf %t
2// RUN: split-file %s %t
3//
4// At first build Stable.pcm that references Movable.framework from StableFrameworks.
5// RUN: %clang_cc1 -fsyntax-only -F %t/JustBuilt -F %t/StableFrameworks %t/prepopulate-module-cache.m \
6// RUN:            -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache
7//
8// Now add Movable.framework to JustBuilt.
9// RUN: mkdir %t/JustBuilt
10// RUN: cp -r %t/StableFrameworks/Movable.framework %t/JustBuilt/Movable.framework
11//
12// Load Movable.pcm at first for JustBuilt location and then in the same TU try to load transitively for StableFrameworks location.
13// RUN: %clang_cc1 -fsyntax-only -F %t/JustBuilt -F %t/StableFrameworks %t/trigger-error.m \
14// RUN:            -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache
15
16// Test the case when a dependent module is found in a different location, so
17// module cache has outdated information.
18
19//--- StableFrameworks/Movable.framework/Headers/Movable.h
20// empty
21
22//--- StableFrameworks/Movable.framework/Modules/module.modulemap
23framework module Movable {
24  header "Movable.h"
25  export *
26}
27
28
29//--- StableFrameworks/Stable.framework/Headers/Stable.h
30#import <Movable/Movable.h>
31
32//--- StableFrameworks/Stable.framework/Modules/module.modulemap
33framework module Stable {
34  header "Stable.h"
35  export *
36}
37
38
39//--- prepopulate-module-cache.m
40#import <Stable/Stable.h>
41
42//--- trigger-error.m
43#import <Movable/Movable.h>
44#import <Stable/Stable.h>
45