1// RUN: rm -rf %t 2// RUN: cd %S 3// 4// RUN: %clang_cc1 -fmodules -x c++ -std=c++11 \ 5// RUN: -I Inputs/stress1 \ 6// RUN: -fno-implicit-modules \ 7// RUN: -fmodules-cache-path=%t \ 8// RUN: -fmodule-map-file-home-is-cwd \ 9// RUN: -emit-module -fmodule-name=m00 -o %t/m00.pcm \ 10// RUN: Inputs/stress1/module.modulemap 11// 12// RUN: %clang_cc1 -fmodules -x c++ -std=c++11 \ 13// RUN: -I Inputs/stress1 \ 14// RUN: -fno-implicit-modules \ 15// RUN: -fmodules-cache-path=%t \ 16// RUN: -fmodule-map-file-home-is-cwd \ 17// RUN: -emit-module -fmodule-name=m00 -o %t/m00_check.pcm \ 18// RUN: Inputs/stress1/module.modulemap 19// 20// RUN: diff %t/m00.pcm %t/m00_check.pcm 21// 22// RUN: %clang_cc1 -fmodules -x c++ -std=c++11 -fdelayed-template-parsing \ 23// RUN: -I Inputs/stress1 \ 24// RUN: -fno-implicit-modules \ 25// RUN: -fmodules-cache-path=%t \ 26// RUN: -fmodule-map-file-home-is-cwd \ 27// RUN: -emit-module -fmodule-name=m01 -o %t/m01.pcm \ 28// RUN: Inputs/stress1/module.modulemap 29// 30// RUN: %clang_cc1 -fmodules -x c++ -std=c++11 -fdelayed-template-parsing \ 31// RUN: -I Inputs/stress1 \ 32// RUN: -fno-implicit-modules \ 33// RUN: -fmodules-cache-path=%t \ 34// RUN: -fmodule-map-file-home-is-cwd \ 35// RUN: -emit-module -fmodule-name=m01 -o %t/m01_check.pcm \ 36// RUN: Inputs/stress1/module.modulemap 37// 38// RUN: diff %t/m01.pcm %t/m01_check.pcm 39// 40// RUN: %clang_cc1 -fmodules -x c++ -std=c++11 \ 41// RUN: -I Inputs/stress1 \ 42// RUN: -fno-implicit-modules \ 43// RUN: -fmodules-cache-path=%t \ 44// RUN: -fmodule-map-file-home-is-cwd \ 45// RUN: -emit-module -fmodule-name=m02 -o %t/m02.pcm \ 46// RUN: Inputs/stress1/module.modulemap 47// 48// RUN: %clang_cc1 -fmodules -x c++ -std=c++11 \ 49// RUN: -I Inputs/stress1 \ 50// RUN: -fno-implicit-modules \ 51// RUN: -fmodules-cache-path=%t \ 52// RUN: -fmodule-map-file-home-is-cwd \ 53// RUN: -emit-module -fmodule-name=m03 -o %t/m03.pcm \ 54// RUN: Inputs/stress1/module.modulemap 55// 56// RUN: %clang_cc1 -fmodules -x c++ -std=c++11 \ 57// RUN: -I Inputs/stress1 \ 58// RUN: -fno-implicit-modules \ 59// RUN: -fmodules-cache-path=%t \ 60// RUN: -fmodule-map-file-home-is-cwd \ 61// RUN: -fmodule-file=%t/m00.pcm \ 62// RUN: -fmodule-file=%t/m01.pcm \ 63// RUN: -fmodule-file=%t/m02.pcm \ 64// RUN: -fmodule-file=%t/m03.pcm \ 65// RUN: -emit-module -fmodule-name=merge00 -o %t/merge00.pcm \ 66// RUN: Inputs/stress1/module.modulemap 67// 68// RUN: %clang_cc1 -fmodules -x c++ -std=c++11 \ 69// RUN: -I Inputs/stress1 \ 70// RUN: -fno-implicit-modules \ 71// RUN: -fmodules-cache-path=%t \ 72// RUN: -fmodule-map-file-home-is-cwd \ 73// RUN: -fmodule-file=%t/m00.pcm \ 74// RUN: -fmodule-file=%t/m01.pcm \ 75// RUN: -fmodule-file=%t/m02.pcm \ 76// RUN: -fmodule-file=%t/m03.pcm \ 77// RUN: -emit-module -fmodule-name=merge00 -o %t/merge00_check.pcm \ 78// RUN: Inputs/stress1/module.modulemap 79// 80// RUN: diff %t/merge00.pcm %t/merge00_check.pcm 81// 82// RUN: %clang_cc1 -fmodules -x c++ -std=c++11 \ 83// RUN: -I Inputs/stress1 \ 84// RUN: -fno-implicit-modules \ 85// RUN: -fmodules-cache-path=%t \ 86// RUN: -fmodule-map-file-home-is-cwd \ 87// RUN: -fmodule-map-file=Inputs/stress1/module.modulemap \ 88// RUN: -fmodule-file=%t/m00.pcm \ 89// RUN: -fmodule-file=%t/m01.pcm \ 90// RUN: -fmodule-file=%t/m02.pcm \ 91// RUN: -fmodule-file=%t/m03.pcm \ 92// RUN: -fmodule-file=%t/merge00.pcm \ 93// RUN: -verify stress1.cpp -S -emit-llvm -o %t/stress1.ll 94// 95// RUN: %clang_cc1 -fmodules -x c++ -std=c++11 \ 96// RUN: -I Inputs/stress1 \ 97// RUN: -fno-implicit-modules \ 98// RUN: -fmodules-cache-path=%t \ 99// RUN: -fmodule-map-file-home-is-cwd \ 100// RUN: -fmodule-map-file=Inputs/stress1/module.modulemap \ 101// RUN: -fmodule-file=%t/m00.pcm \ 102// RUN: -fmodule-file=%t/m01.pcm \ 103// RUN: -fmodule-file=%t/m02.pcm \ 104// RUN: -fmodule-file=%t/m03.pcm \ 105// RUN: -fmodule-file=%t/merge00.pcm \ 106// RUN: -verify stress1.cpp -S -emit-llvm -o %t/stress1_check.ll 107// 108// RUN: diff -u %t/stress1.ll %t/stress1_check.ll 109// 110// RUN: %clang_cc1 -fmodules -x c++ -std=c++11 \ 111// RUN: -I Inputs/stress1 \ 112// RUN: -fmodules-cache-path=%t \ 113// RUN: -fmodule-map-file-home-is-cwd \ 114// RUN: -fmodule-file=%t/m00.pcm \ 115// RUN: -fmodule-file=%t/m01.pcm \ 116// RUN: -fmodule-file=%t/m02.pcm \ 117// RUN: -fmodule-file=%t/m03.pcm \ 118// RUN: -emit-module -fmodule-name=merge00 -o /dev/null \ 119// RUN: -DMERGE_NO_REEXPORT \ 120// RUN: Inputs/stress1/module.modulemap 121// 122// expected-no-diagnostics 123 124#include "m00.h" 125#include "m01.h" 126#include "m02.h" 127#include "m03.h" 128 129#include "merge00.h" 130 131int f() { return N01::S00('a').method00('b') + (int)N00::S00(42) + function00(42) + g(); } 132 133int f2() { 134 return pragma_weak00() + pragma_weak01() + pragma_weak02() + 135 pragma_weak03 + pragma_weak04 + pragma_weak05; 136} 137