-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix diagnostic outputs for piping stdin.
- Loading branch information
1 parent
758fb41
commit 3480baa
Showing
5 changed files
with
84 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
OPENQASM 3.0; | ||
// Ensure piping of input also works with diagnostics. | ||
// TODO: Once https://github.com/openqasm/qe-qasm/issues/35 | ||
// is fixed this test will error and the workaround | ||
// in OpenQASM3Frontend.cpp for line number offsets | ||
// will need to be removed for the test to pass. | ||
// RUN: cat %s | ( qss-compiler -X=qasm --emit=mlir || true ) 2>&1 | FileCheck %s --dump-input=fail | ||
// RUN: ( qss-compiler -X=qasm --emit=mlir %s || true ) 2>&1 | FileCheck %s --dump-input=fail | ||
|
||
int a; | ||
int b; | ||
|
||
a &&& b; | ||
// CHECK: error: While parsing OpenQASM3 input: syntax error, unexpected '&' | ||
// CHECK: a &&& b; | ||
// CHECK: ^ |
21 changes: 21 additions & 0 deletions
21
test/Frontend/OpenQASM3/diagnostics-unsupported-error.qasm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
OPENQASM 3.0; | ||
// Ensure piping of input also works with diagnostics. | ||
// TODO: Once https://github.com/openqasm/qe-qasm/issues/35 | ||
// is fixed this test will error and the workaround | ||
// in QUIRGenQASM3Visitor.cpp | ||
// for line number offsets | ||
// will need to be removed for the test to pass. | ||
// RUN: cat %s | ( qss-compiler -X=qasm --emit=mlir || true ) 2>&1 | FileCheck %s --dump-input=fail | ||
// RUN: ( qss-compiler -X=qasm --emit=mlir %s || true ) 2>&1 | FileCheck %s --dump-input=fail | ||
|
||
int a; | ||
float b; | ||
int c; | ||
c = float(a) + b; | ||
|
||
// CHECK: error: Unsupported cast destination type ASTTypeFloat | ||
// CHECK: c = float(a) + b; | ||
// CHECK: ^ | ||
// CHECK: error: Addition is not supported on value of type: 'none' | ||
// CHECK: c = float(a) + b; | ||
// CHECK: ^ |