27 lines · cpp
1// RUN: rm -rf %t2// RUN: mkdir %t3// RUN: echo 'module a { header "a.h" header "x.h" } module b { header "b.h" }' > %t/modulemap4// RUN: echo 'extern int t;' > %t/t.h5// RUN: echo '#include "t.h"' > %t/a.h6// RUN: echo '#include "t.h"' > %t/b.h7// RUN: echo '#include "t.h"' > %t/x.h8 9// RUN: %clang_cc1 -fmodules -I%t -fmodules-cache-path=%t -fmodule-map-file=%t/modulemap -fmodules-embed-all-files %s -verify10//11// RUN: %clang_cc1 -fmodules -I%t -fmodules-embed-all-files %t/modulemap -fmodule-name=a -x c++ -emit-module -o %t/a.pcm12// RUN: %clang_cc1 -fmodules -I%t -fmodules-embed-all-files %t/modulemap -fmodule-name=b -x c++ -emit-module -o %t/b.pcm13// FIXME: This test is flaky on Windows because attempting to delete a file14// after writing it just doesn't seem to work well, at least not in the lit15// shell.16// UNSUPPORTED: system-windows17// RUN: rm %t/x.h18// RUN: %clang_cc1 -fmodules -I%t -fmodule-map-file=%t/modulemap -fmodule-file=%t/a.pcm -fmodule-file=%t/b.pcm %s -verify19#include "a.h"20char t; // expected-error {{different type}}21// expected-note@t.h:1 {{here}}22#include "t.h"23#include "b.h"24char t; // expected-error {{different type}}25// expected-note@t.h:1 {{here}}26 27