1 // Test check that consuming -E -fdirectives-only output produces the expected
6 // RUN: split-file %s %t
9 // RUN: %clang_cc1 -std=c++20 -E -fdirectives-only -xc++-user-header hu-01.h \
12 // RUN: %clang_cc1 -std=c++20 -emit-header-unit \
13 // RUN: -xc++-user-header-cpp-output hu-01.iih -o hu-01.pcm
15 // RUN: %clang_cc1 -std=c++20 -emit-header-unit -xc++-user-header hu-02.h \
16 // RUN: -DFOO -fmodule-file=hu-01.pcm -o hu-02.pcm -Rmodule-import 2>&1 | \
17 // RUN: FileCheck --check-prefix=CHECK-IMP %s -DTDIR=%t
26 #define SHOULD_NOT_BE_DEFINED -1
27 #undef SHOULD_NOT_BE_DEFINED
30 // expected-no-diagnostics
33 export import
"hu-01.h";
34 #if !defined(FORTYTWO) || FORTYTWO != 42
35 #error FORTYTWO missing in hu-02
39 #error __GUARD missing in hu-02
42 #ifdef SHOULD_NOT_BE_DEFINED
43 #error SHOULD_NOT_BE_DEFINED is visible
46 // Make sure that we have not discarded macros from the builtin file.
48 #error we dropped a defined macro
54 #define FOO_BRANCH(X) (X) + 1
55 inline int foo(int x
) {
61 #define BAR_BRANCH(X) (X) + 2
62 inline int bar(int x
) {
68 // CHECK-IMP: remark: importing module '.{{/|\\\\?}}hu-01.h' from 'hu-01.pcm'