[WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349
[llvm-project.git] / flang / test / Frontend / prescanner-diag.f90
blob079497774437b89b191666ad9ab68571e02a7bc6
1 ! Test that the driver correctly reports diagnostics from the prescanner, no
2 ! matter what driver action/phase is run. We need this test as Flang currently
3 ! has no central API for managing the diagnostics. For this reason the driver
4 ! needs to make sure that the diagnostics are indeed issued (rather that relying
5 ! on some DiagnosticsEngine).
7 !-----------
8 ! RUN LINES
9 !-----------
10 ! Test with -E (i.e. PrintPreprocessedAction, stops after prescanning)
11 ! RUN: %flang -E -I %S/Inputs/ %s 2>&1 | FileCheck %s
12 ! RUN: %flang_fc1 -E -I %S/Inputs/ %s 2>&1 | FileCheck %s
14 ! Test with -fsyntax-only (i.e. ParseSyntaxOnlyAction, stops after semantic checks)
15 ! RUN: %flang -fsyntax-only -I %S/Inputs/ %s 2>&1 | FileCheck %s
16 ! RUN: %flang_fc1 -fsyntax-only -I %S/Inputs/ %s 2>&1 | FileCheck %s
18 !-----------------------
19 ! EXPECTED OUTPUT
20 !-----------------------
21 ! CHECK: prescanner-diag.f90:27:20: portability: #include: extra stuff ignored after file name
22 ! CHECK: prescanner-diag.f90:28:20: portability: #include: extra stuff ignored after file name
24 !-------
25 ! INPUT
26 !-------
27 #include <empty.h> comment
28 #include "empty.h" comment
29 end