blob: 9b563fef821c5c4c5892bbdec795d57d1428c582 [file] [log] [blame]
Stephen Hines176edba2014-12-01 14:53:08 -08001// RUN: rm -rf %t
Stephen Hines0e2c34f2015-03-23 12:09:02 -07002// 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
3// 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
4// 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
5//
6// 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
7// 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
8// 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
Stephen Hines176edba2014-12-01 14:53:08 -08009#import "diamond_right.h"
10#import "diamond_right.h" // to check that imports get their own line
Stephen Hines0e2c34f2015-03-23 12:09:02 -070011#include "file.h"
Stephen Hines176edba2014-12-01 14:53:08 -080012void test() {
13 top_left_before();
14 left_and_right();
15}
16
17
18// CHECK: int left_and_right(int *);{{$}}
19// CHECK-NEXT: @import diamond_left; /* clang -E: implicit import for "{{.*}}diamond_left.h" */{{$}}
20
21// CHECK: @import diamond_right; /* clang -E: implicit import for "{{.*}}diamond_right.h" */{{$}}
22// CHECK: @import diamond_right; /* clang -E: implicit import for "{{.*}}diamond_right.h" */{{$}}
Stephen Hines0e2c34f2015-03-23 12:09:02 -070023// CHECK: @import file; /* clang -E: implicit import for "{{.*}}file.h" */{{$}}
Stephen Hines176edba2014-12-01 14:53:08 -080024// CHECK-NEXT: void test() {{{$}}
25// CHECK-NEXT: top_left_before();{{$}}
26// CHECK-NEXT: left_and_right();{{$}}
27// CHECK-NEXT: }{{$}}