1// RUN: rm -rf %t
2// RUN: mkdir %t
3
4// RUN: %hmaptool write %S/Inputs/framework-public-includes-private/a.hmap.json %t/a.hmap
5// RUN: %hmaptool write %S/Inputs/framework-public-includes-private/z.hmap.json %t/z.hmap
6
7// RUN: sed -e "s@TEST_DIR@%{/S:regex_replacement}/Inputs/framework-public-includes-private@g" \
8// RUN:   %S/Inputs/framework-public-includes-private/z.yaml > %t/z.yaml
9
10// The output with and without modules should be the same, without modules first.
11// RUN: %clang_cc1 \
12// RUN:   -iquote %t/z.hmap -iquote %t/a.hmap -ivfsoverlay %t/z.yaml \
13// RUN:   -F%S/Inputs/framework-public-includes-private \
14// RUN:   -fsyntax-only %s -verify
15
16// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache \
17// RUN:   -iquote %t/z.hmap -iquote %t/a.hmap -ivfsoverlay %t/z.yaml \
18// RUN:   -F%S/Inputs/framework-public-includes-private \
19// RUN:   -fsyntax-only %s \
20// RUN:   2>%t/stderr
21
22// The same warnings show up when modules is on but -verify doesn't get it
23// because they only show up under the module A building context.
24// RUN: FileCheck --input-file=%t/stderr %s
25// CHECK: public framework header includes private framework header 'A/APriv.h'
26// CHECK: public framework header includes private framework header 'A/APriv2.h'
27// CHECK: public framework header includes private framework header 'Z/ZPriv.h'
28
29#import "A.h"
30
31int bar() { return foo(); }
32
33// expected-warning@Inputs/framework-public-includes-private/A.framework/Headers/A.h:1{{public framework header includes private framework header 'A/APriv.h'}}
34// expected-warning@Inputs/framework-public-includes-private/A.framework/Headers/A.h:2{{public framework header includes private framework header 'A/APriv2.h'}}
35// expected-warning@Inputs/framework-public-includes-private/flat-header-path/Z.h:2{{public framework header includes private framework header 'Z/ZPriv.h'}}
36