diff options
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Modules/Inputs/preprocess/file.h | 3 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/preprocess/fwd.h | 1 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/preprocess/module.modulemap | 2 | ||||
| -rw-r--r-- | clang/test/Modules/preprocess.m | 12 |
4 files changed, 15 insertions, 3 deletions
diff --git a/clang/test/Modules/Inputs/preprocess/file.h b/clang/test/Modules/Inputs/preprocess/file.h new file mode 100644 index 00000000000..808ade5768b --- /dev/null +++ b/clang/test/Modules/Inputs/preprocess/file.h @@ -0,0 +1,3 @@ +struct __FILE; +#include "fwd.h" +typedef struct __FILE FILE; diff --git a/clang/test/Modules/Inputs/preprocess/fwd.h b/clang/test/Modules/Inputs/preprocess/fwd.h new file mode 100644 index 00000000000..4a19c6d0c05 --- /dev/null +++ b/clang/test/Modules/Inputs/preprocess/fwd.h @@ -0,0 +1 @@ +struct __FILE; diff --git a/clang/test/Modules/Inputs/preprocess/module.modulemap b/clang/test/Modules/Inputs/preprocess/module.modulemap new file mode 100644 index 00000000000..a5c5b61dddc --- /dev/null +++ b/clang/test/Modules/Inputs/preprocess/module.modulemap @@ -0,0 +1,2 @@ +module fwd { header "fwd.h" export * } +module file { header "file.h" export * } diff --git a/clang/test/Modules/preprocess.m b/clang/test/Modules/preprocess.m index 5c32997f62f..9b563fef821 100644 --- a/clang/test/Modules/preprocess.m +++ b/clang/test/Modules/preprocess.m @@ -1,9 +1,14 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I %S/Inputs -include %S/Inputs/preprocess-prefix.h -E %s | FileCheck -strict-whitespace %s -// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I %S/Inputs -x objective-c-header -emit-pch %S/Inputs/preprocess-prefix.h -o %t.pch -// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I %S/Inputs -include-pch %t.pch -E %s | FileCheck -strict-whitespace %s +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I %S/Inputs -I %S/Inputs/preprocess -include %S/Inputs/preprocess-prefix.h -E %s | FileCheck -strict-whitespace %s +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I %S/Inputs -I %S/Inputs/preprocess -x objective-c-header -emit-pch %S/Inputs/preprocess-prefix.h -o %t.pch +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I %S/Inputs -I %S/Inputs/preprocess -include-pch %t.pch -E %s | FileCheck -strict-whitespace %s +// +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I %S/Inputs -I %S/Inputs/preprocess -x objective-c++ -include %S/Inputs/preprocess-prefix.h -E %s | FileCheck -strict-whitespace %s +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I %S/Inputs -I %S/Inputs/preprocess -x objective-c++-header -emit-pch %S/Inputs/preprocess-prefix.h -o %t.pch +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I %S/Inputs -I %S/Inputs/preprocess -x objective-c++ -include-pch %t.pch -E %s | FileCheck -strict-whitespace %s #import "diamond_right.h" #import "diamond_right.h" // to check that imports get their own line +#include "file.h" void test() { top_left_before(); left_and_right(); @@ -15,6 +20,7 @@ void test() { // CHECK: @import diamond_right; /* clang -E: implicit import for "{{.*}}diamond_right.h" */{{$}} // CHECK: @import diamond_right; /* clang -E: implicit import for "{{.*}}diamond_right.h" */{{$}} +// CHECK: @import file; /* clang -E: implicit import for "{{.*}}file.h" */{{$}} // CHECK-NEXT: void test() {{{$}} // CHECK-NEXT: top_left_before();{{$}} // CHECK-NEXT: left_and_right();{{$}} |

