blob: 4df741cfe4a3384f9316a7c70c5b2a10086d5bec [file] [log] [blame]
Richard Smith5974ee62014-10-22 23:52:04 +00001// RUN: rm -rf %t
Richard Smith47972af2015-06-16 00:08:24 +00002// RUN: %clang_cc1 -fimplicit-module-maps -fmodules-cache-path=%t -fmodules-strict-decluse -fmodule-name=XG -I %S/Inputs/declare-use %s -verify
3// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fmodules-strict-decluse -fmodule-name=XG -I %S/Inputs/declare-use %s -verify -fno-modules-error-recovery
Richard Smith5974ee62014-10-22 23:52:04 +00004
5#define GIMME_A_K
6#include "k.h"
7
8#define GIMME_AN_L
9#include "l.h" // expected-error {{module XG does not depend on a module exporting 'l.h'}}
10
Richard Smith202210b2014-10-24 20:23:01 +000011#include "m2.h" // expected-error {{module XG does not depend on a module exporting 'm2.h'}}
12const int use_m = m; // expected-error {{undeclared identifier}}
13
14#define GIMME_AN_M
15#include "m.h" // expected-error {{use of private header from outside its module: 'm.h'}}
16const int use_m_2 = m;
17
Richard Smith5974ee62014-10-22 23:52:04 +000018const int g = k + l;