1 // RUN: %clang_cc1 -std=c++2a -emit-header-module -fmodule-name=attrs -x c++-header %S/Inputs/empty.h %S/Inputs/attrs.h -o %t.pcm
2 // RUN: %clang_cc1 -std=c++2a %s -fmodule-file=%t.pcm -E -verify -I%S/Inputs | FileCheck %s
3 
4 #define SEMI ;
5 // expected-error@+1 {{semicolon terminating header import declaration cannot be produced by a macro}}
6 import "empty.h" SEMI // CHECK: import attrs.{{.*}};
7 
8 #define IMPORT import "empty.h"
9 IMPORT; // CHECK: import attrs.{{.*}};
10 
11 #define IMPORT_ANGLED import <empty.h>
12 IMPORT_ANGLED; // CHECK: import attrs.{{.*}};
13 
14 // Ensure that macros only become visible at the semicolon.
15 // CHECK: import attrs.{{.*}} ATTRS ;
16 import "attrs.h" ATTRS ;
17 // CHECK: {{\[\[}} ]] int n;
18 ATTRS int n;
19