blob: 5db1f3f33e9476ef800e49026c143b12cf7d1f99 [file] [log] [blame]
Douglas Gregor718292f2011-11-11 19:10:28 +00001// RUN: rm -rf %t
Richard Smith47972af2015-06-16 00:08:24 +00002// RUN: %clang_cc1 -x objective-c -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/normal-module-map %s -verify
Douglas Gregorb65dbff2011-11-16 23:02:25 +00003#include "Umbrella/umbrella_sub.h"
Douglas Gregor88bdfb02011-11-11 23:20:24 +00004
5int getUmbrella() {
Douglas Gregorb65dbff2011-11-16 23:02:25 +00006 return umbrella + umbrella_sub;
Douglas Gregor88bdfb02011-11-11 23:20:24 +00007}
8
Douglas Gregorc50d4922012-12-11 22:11:52 +00009@import Umbrella2;
Douglas Gregoraf28ec82011-11-12 00:05:07 +000010
Douglas Gregor9dc32122011-11-16 20:05:18 +000011#include "a1.h"
Douglas Gregor718292f2011-11-11 19:10:28 +000012#include "b1.h"
13#include "nested/nested2.h"
14
15int test() {
16 return a1 + b1 + nested2;
17}
Douglas Gregor524e33e2011-12-08 19:11:24 +000018
Douglas Gregorc50d4922012-12-11 22:11:52 +000019@import nested_umbrella.a;
Douglas Gregor524e33e2011-12-08 19:11:24 +000020
21int testNestedUmbrellaA() {
22 return nested_umbrella_a;
23}
24
25int testNestedUmbrellaBFail() {
Andy Gibbsfcc699a2013-04-17 08:06:46 +000026 return nested_umbrella_b;
Richard Smithe156254d2013-08-20 20:35:18 +000027 // expected-error@-1{{declaration of 'nested_umbrella_b' must be imported from module 'nested_umbrella.b' before it is required}}
28 // expected-note@Inputs/normal-module-map/nested_umbrella/b.h:1{{previous}}
Douglas Gregor524e33e2011-12-08 19:11:24 +000029}
30
Douglas Gregorc50d4922012-12-11 22:11:52 +000031@import nested_umbrella.b;
Douglas Gregor524e33e2011-12-08 19:11:24 +000032
33int testNestedUmbrellaB() {
34 return nested_umbrella_b;
35}
Douglas Gregor056396a2012-10-12 21:15:50 +000036
Douglas Gregorc50d4922012-12-11 22:11:52 +000037@import nested_umbrella.a_extras;
Douglas Gregor056396a2012-10-12 21:15:50 +000038
Douglas Gregorc50d4922012-12-11 22:11:52 +000039@import nested_umbrella._1;
Douglas Gregor056396a2012-10-12 21:15:50 +000040
Douglas Gregorc50d4922012-12-11 22:11:52 +000041@import nested_umbrella.decltype_;
Douglas Gregor056396a2012-10-12 21:15:50 +000042
43int testSanitizedName() {
44 return extra_a + one + decltype_val;
45}