|
1 | | -// FIXME: There're some inconsistencies between interactive and non-interactive |
2 | | -// modes. For example, when clang-repl runs in the interactive mode, issues an |
3 | | -// error, and then successfully recovers if we decide it's a success then for |
4 | | -// the non-interactive mode the exit code should be a failure. |
5 | | -// RUN: clang-repl "int x = 10;" "int y=7; err;" "int y = 10;" |
6 | 1 | // REQUIRES: host-supports-jit |
7 | 2 | // UNSUPPORTED: system-aix |
8 | | -// RUN: cat %s | not clang-repl | FileCheck %s |
9 | | -BOOM! |
| 3 | +// clang-repl can be called from the prompt in non-interactive mode as a |
| 4 | +// calculator in shell scripts, for example. In that case if there is an error |
| 5 | +// we should set the exit code as failure. |
| 6 | +// RUN: not clang-repl "int x = 10;" "int y=7; err;" "int y = 10;" |
| 7 | + |
| 8 | +// In interactive (REPL) mode, we can have errors but we should exit with |
| 9 | +// success because errors in the input code are part of the interactive use. |
| 10 | +// RUN: cat %s | clang-repl | FileCheck %s |
| 11 | + |
| 12 | +// However, interactive mode should fail when we specified -verify and there |
| 13 | +// was a diagnostic mismatches. This will make the testsuite fail as intended. |
| 14 | +// RUN: cat %s | not clang-repl -Xcc -Xclang -Xcc -verify | FileCheck %s |
| 15 | + |
| 16 | +BOOM! // expected-error {{intended to fail the -verify test}} |
10 | 17 | extern "C" int printf(const char *, ...); |
11 | 18 | int i = 42; |
12 | 19 | auto r1 = printf("i = %d\n", i); |
|
0 commit comments