blob: f300558dd7f71ebcb81641408e5cce1f61c7f8b8 [file] [log] [blame]
Richard Smith64daf7b2015-12-01 03:32:49 +00001// RUN: rm -rf %t
2// RUN: mkdir %t
Richard Smith8a3e39a2016-03-28 21:31:09 +00003// RUN: echo 'module a { header "a.h" header "x.h" } module b { header "b.h" }' > %t/modulemap
Richard Smith64daf7b2015-12-01 03:32:49 +00004// RUN: echo 'extern int t;' > %t/t.h
5// RUN: echo '#include "t.h"' > %t/a.h
6// RUN: echo '#include "t.h"' > %t/b.h
Richard Smith8a3e39a2016-03-28 21:31:09 +00007// RUN: echo '#include "t.h"' > %t/x.h
Richard Smith64daf7b2015-12-01 03:32:49 +00008
9// RUN: %clang_cc1 -fmodules -I%t -fmodules-cache-path=%t -fmodule-map-file=%t/modulemap -fmodules-embed-all-files %s -verify
Richard Smith8a3e39a2016-03-28 21:31:09 +000010//
11// RUN: %clang_cc1 -fmodules -I%t -fmodules-embed-all-files %t/modulemap -fmodule-name=a -x c++ -emit-module -o %t/a.pcm
12// RUN: %clang_cc1 -fmodules -I%t -fmodules-embed-all-files %t/modulemap -fmodule-name=b -x c++ -emit-module -o %t/b.pcm
13// RUN: rm %t/x.h
14// RUN: %clang_cc1 -fmodules -I%t -fmodule-map-file=%t/modulemap -fmodule-file=%t/a.pcm -fmodule-file=%t/b.pcm %s -verify
Richard Smith64daf7b2015-12-01 03:32:49 +000015#include "a.h"
16char t; // expected-error {{different type}}
17// expected-note@t.h:1 {{here}}
18#include "t.h"
19#include "b.h"
20char t; // expected-error {{different type}}
21// expected-note@t.h:1 {{here}}