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