2015-12-01 11:32:49 +08:00
|
|
|
// RUN: rm -rf %t
|
|
|
|
// RUN: mkdir %t
|
2016-03-29 05:31:09 +08:00
|
|
|
// RUN: echo 'module a { header "a.h" header "x.h" } module b { header "b.h" }' > %t/modulemap
|
2015-12-01 11:32:49 +08:00
|
|
|
// RUN: echo 'extern int t;' > %t/t.h
|
|
|
|
// RUN: echo '#include "t.h"' > %t/a.h
|
|
|
|
// RUN: echo '#include "t.h"' > %t/b.h
|
2016-03-29 05:31:09 +08:00
|
|
|
// RUN: echo '#include "t.h"' > %t/x.h
|
2015-12-01 11:32:49 +08:00
|
|
|
|
|
|
|
// RUN: %clang_cc1 -fmodules -I%t -fmodules-cache-path=%t -fmodule-map-file=%t/modulemap -fmodules-embed-all-files %s -verify
|
2016-03-29 05:31:09 +08:00
|
|
|
//
|
|
|
|
// RUN: %clang_cc1 -fmodules -I%t -fmodules-embed-all-files %t/modulemap -fmodule-name=a -x c++ -emit-module -o %t/a.pcm
|
|
|
|
// RUN: %clang_cc1 -fmodules -I%t -fmodules-embed-all-files %t/modulemap -fmodule-name=b -x c++ -emit-module -o %t/b.pcm
|
2016-07-22 05:07:47 +08:00
|
|
|
// FIXME: This test is flaky on Windows because attempting to delete a file
|
|
|
|
// after writing it just doesn't seem to work well, at least not in the lit
|
|
|
|
// shell.
|
|
|
|
// REQUIRES: shell
|
2016-03-29 05:31:09 +08:00
|
|
|
// RUN: rm %t/x.h
|
|
|
|
// RUN: %clang_cc1 -fmodules -I%t -fmodule-map-file=%t/modulemap -fmodule-file=%t/a.pcm -fmodule-file=%t/b.pcm %s -verify
|
2015-12-01 11:32:49 +08:00
|
|
|
#include "a.h"
|
|
|
|
char t; // expected-error {{different type}}
|
|
|
|
// expected-note@t.h:1 {{here}}
|
|
|
|
#include "t.h"
|
|
|
|
#include "b.h"
|
|
|
|
char t; // expected-error {{different type}}
|
|
|
|
// expected-note@t.h:1 {{here}}
|
2016-07-22 05:07:47 +08:00
|
|
|
|