blob: 3c9299c64ea5cf44ade92a52408c28f060992b35 [file] [log] [blame]
Reid Kleckner1cbd9aa2015-02-25 19:17:48 +00001// RUN: rm -rf %t
2
3// First, build two modules that both re-export the same header.
Richard Smith47972af2015-06-16 00:08:24 +00004// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodule-name=b -o %t/b.pcm \
Reid Kleckner1cbd9aa2015-02-25 19:17:48 +00005// RUN: -emit-module %S/Inputs/merge-vtable-codegen/merge-vtable-codegen.modulemap \
6// RUN: -I %S/Inputs/merge-vtable-codegen
Richard Smith47972af2015-06-16 00:08:24 +00007// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodule-name=c -o %t/c.pcm \
Reid Kleckner1cbd9aa2015-02-25 19:17:48 +00008// RUN: -emit-module %S/Inputs/merge-vtable-codegen/merge-vtable-codegen.modulemap \
9// RUN: -I %S/Inputs/merge-vtable-codegen
10
11// Use the two modules in a single compile.
Richard Smith47972af2015-06-16 00:08:24 +000012// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodule-file=%t/b.pcm -fmodule-file=%t/c.pcm \
Reid Kleckner1cbd9aa2015-02-25 19:17:48 +000013// RUN: -fmodule-map-file=%S/Inputs/merge-vtable-codegen/merge-vtable-codegen.modulemap \
14// RUN: -emit-llvm -o %t/test.o %s
15
16// Note that order is important:
17// Module 'c' just reexports A, while module 'b' defines a method that uses a
18// virtual method of A.
19#include "Inputs/merge-vtable-codegen/c.h"
20#include "Inputs/merge-vtable-codegen/b.h"
21
22void t() {
23 b(nullptr);
24}