Skip to content

Commit

Permalink
Add a test with default only switch
Browse files Browse the repository at this point in the history
  • Loading branch information
mbhealy committed Apr 29, 2024
1 parent ae58dbe commit c272589
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/Frontend/OpenQASM3/switch-default-only.qasm3
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
OPENQASM 3.0;
// RUN: qss-compiler -X=qasm --emit=ast-pretty %s | FileCheck %s --match-full-lines --check-prefix AST-PRETTY
// RUN: qss-compiler -X=qasm --emit=mlir %s --enable-circuits-from-qasm=false| FileCheck %s --match-full-lines --check-prefixes MLIR
// RUN: qss-compiler -X=qasm --emit=mlir %s --enable-circuits-from-qasm | FileCheck %s --match-full-lines --check-prefixes MLIR

//
// This code is part of Qiskit.
//
// (C) Copyright IBM 2023, 2024.
//
// This code is licensed under the Apache License, Version 2.0 with LLVM
// Exceptions. You may obtain a copy of this license in the LICENSE.txt
// file in the root directory of this source tree.
//
// Any modifications or derivative works of this code must retain this
// copyright notice, and modified files need to carry a notice indicating
// that they have been altered from the originals.

int i = 15;
qubit $0;
// MLIR: quir.switch %{{.*}}{
// MLIR-NEXT: }[]
// AST-PRETTY: SwitchStatementNode(SwitchQuantity(name=i, type=ASTTypeIdentifier),
switch (i) {
// AST-PRETTY:statements=[
// AST-PRETTY:],
// AST-PRETTY:default statement=[
// AST-PRETTY:])
default: {
}
break;
}

0 comments on commit c272589

Please sign in to comment.