File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 11// REQUIRES: host-supports-jit
22// UNSUPPORTED: system-aix
3- // RUN: cat %s | clang-repl | FileCheck %s
3+ // RUN: cat %s | clang-repl -Xcc -Xclang -Xcc -verify | FileCheck %s
4+
5+ // expected-no-diagnostics
46
57extern " C" int printf (const char *,...);
68int i = \
@@ -17,8 +19,7 @@ void f(int x) \
1719f (i);
1820// CHECK: x=12
1921
20- // FIXME: Support preprocessor directives.
21- // #if 0 \
22- // #error "Can't be!" \
23- // #endif
22+ #if 0 \
23+ #error "Can't be!" \
24+ #endif
2425
Original file line number Diff line number Diff line change @@ -232,8 +232,10 @@ int main(int argc, const char **argv) {
232232 llvm::StringRef L = *Line;
233233 L = L.trim ();
234234 if (L.ends_with (" \\ " )) {
235- // FIXME: Support #ifdef X \ ...
236235 Input += L.drop_back (1 );
236+ // If it is a preprocessor directive, new lines matter.
237+ if (L.starts_with (' #' ))
238+ Input += " \n " ;
237239 LE.setPrompt (" clang-repl... " );
238240 continue ;
239241 }
You can’t perform that action at this time.
0 commit comments