blob: 5dbf3d1bd95f604986083fedcd930ce25f2c7088 [file] [log] [blame]
Richard Smith8cebe372015-02-25 22:20:13 +00001// RUN: rm -rf %t
2
Richard Smith47972af2015-06-16 00:08:24 +00003// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodule-name=b -o %t/b.pcm \
Richard Smith8cebe372015-02-25 22:20:13 +00004// RUN: -emit-module %S/Inputs/merge-decl-context/merge-decl-context.modulemap -I%S/Inputs \
5// RUN: -I %S/Inputs/merge-decl-context
Richard Smith47972af2015-06-16 00:08:24 +00006// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodule-name=c -o %t/c.pcm \
Richard Smith0b884372015-02-27 00:25:58 +00007// RUN: -fmodule-file=%t/b.pcm -fno-implicit-modules \
8// RUN: -emit-module %S/Inputs/merge-decl-context/merge-decl-context.modulemap -I%S/Inputs \
9// RUN: -I %S/Inputs/merge-decl-context
Richard Smith47972af2015-06-16 00:08:24 +000010// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodule-name=d -o %t/d.pcm \
Richard Smith0b884372015-02-27 00:25:58 +000011// RUN: -fmodule-file=%t/b.pcm -fno-implicit-modules \
Richard Smith8cebe372015-02-25 22:20:13 +000012// RUN: -emit-module %S/Inputs/merge-decl-context/merge-decl-context.modulemap -I%S/Inputs \
13// RUN: -I %S/Inputs/merge-decl-context
14
15// Use the two modules in a single compile.
Richard Smith47972af2015-06-16 00:08:24 +000016// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodule-file=%t/c.pcm -fmodule-file=%t/b.pcm \
Richard Smith0b884372015-02-27 00:25:58 +000017// RUN: -fmodule-file=%t/d.pcm -fno-implicit-modules \
Richard Smith8cebe372015-02-25 22:20:13 +000018// RUN: -fmodule-map-file=%S/Inputs/merge-decl-context/merge-decl-context.modulemap -I%S/Inputs \
19// RUN: -emit-llvm -o %t/test.o %s
20
Richard Smithfe1bc702016-04-08 19:57:40 +000021// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fmodules-cache-path=%t \
22// RUN: -fmodule-map-file=%S/Inputs/merge-decl-context/merge-decl-context.modulemap -I%S/Inputs \
23// RUN: -emit-llvm -o %t/test.o -DNO_TEXTUAL_INCLUSION %s
24
25#ifndef NO_TEXTUAL_INCLUSION
Richard Smith8cebe372015-02-25 22:20:13 +000026#include "Inputs/merge-decl-context/a.h"
Richard Smithfe1bc702016-04-08 19:57:40 +000027#endif
Richard Smith8cebe372015-02-25 22:20:13 +000028#include "Inputs/merge-decl-context/b.h"
29#include "Inputs/merge-decl-context/c.h"
Richard Smith0b884372015-02-27 00:25:58 +000030#include "Inputs/merge-decl-context/d.h"
Richard Smith8cebe372015-02-25 22:20:13 +000031
32void t() {
33 ff(42);
34}
Richard Smithfe1bc702016-04-08 19:57:40 +000035
36static_assert(Aggregate{.member = 1}.member == 1, "");