| 1 |
// RUN: rm -rf %t |
| 2 |
// RUN: split-file %s %t |
| 3 |
// RUN: %clang_cc1 -std=c17 -fmodules-cache-path=%t/no-lsv -fmodules -fimplicit-module-maps -I%t %t/multiple-imports.m -verify |
| 4 |
// RUN: %clang_cc1 -std=c17 -fmodules-cache-path=%t/lsv -fmodules -fimplicit-module-maps -fmodules-local-submodule-visibility -I%t %t/multiple-imports.m -verify |
| 5 |
|
| 6 |
//--- multiple-imports.m |
| 7 |
// expected-no-diagnostics |
| 8 |
#import <one.h> |
| 9 |
#import <assert.h> |
| 10 |
void test(void) { |
| 11 |
assert(0); |
| 12 |
} |
| 13 |
|
| 14 |
//--- module.modulemap |
| 15 |
module Submodules [system] { |
| 16 |
module one { |
| 17 |
header "one.h" |
| 18 |
export * |
| 19 |
} |
| 20 |
module two { |
| 21 |
header "two.h" |
| 22 |
export * |
| 23 |
} |
| 24 |
} |
| 25 |
|
| 26 |
module libc [system] { |
| 27 |
textual header "assert.h" |
| 28 |
} |
| 29 |
|
| 30 |
//--- one.h |
| 31 |
#ifndef one_h |
| 32 |
#define one_h |
| 33 |
#endif |
| 34 |
|
| 35 |
//--- two.h |
| 36 |
#ifndef two_h |
| 37 |
#define two_h |
| 38 |
#include <assert.h> |
| 39 |
#endif |
| 40 |
|
| 41 |
//--- assert.h |
| 42 |
#undef assert |
| 43 |
#define assert(expression) ((void)0) |