Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
schweitzpgi committed Jul 25, 2023
1 parent 25aca51 commit 6d777de
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions test/Quake/modeless_effects.qke
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// ========================================================================== //
// Copyright (c) 2022 - 2023 NVIDIA Corporation & Affiliates. //
// All rights reserved. //
// //
// This source code and the accompanying materials are made available under //
// the terms of the Apache License 2.0 which accompanies this distribution. //
// ========================================================================== //

// RUN: cudaq-opt %s --canonicalize | FileCheck %s

func.func @measures(%a0: !quake.wire, %a1: !quake.wire, %a2: !quake.wire,
%a4: !quake.wire) {
%0 = quake.x %a4 : (!quake.wire) -> !quake.wire
%1 = quake.mx %a0 : (!quake.wire) -> i1
%2 = quake.my %a1 : (!quake.wire) -> i1
%3 = quake.mz %a2 : (!quake.wire) -> i1
return
}

// CHECK-LABEL: func.func @measures(
// CHECK-SAME: %[[VAL_0:.*]]: !quake.wire, %[[VAL_1:.*]]: !quake.wire, %[[VAL_2:.*]]: !quake.wire, %[[VAL_3:.*]]: !quake.wire) {
// CHECK: %[[VAL_4:.*]] = quake.mx %[[VAL_0]] : (!quake.wire) -> i1
// CHECK: %[[VAL_5:.*]] = quake.my %[[VAL_1]] : (!quake.wire) -> i1
// CHECK: %[[VAL_6:.*]] = quake.mz %[[VAL_2]] : (!quake.wire) -> i1
// CHECK: return
// CHECK: }

func.func @red_button(%arg0: !quake.wire, %arg1: !quake.wire) {
%0 = quake.h %arg0 : (!quake.wire) -> !quake.wire
%1 = quake.reset %0 : (!quake.wire) -> !quake.wire
%2 = quake.h %arg1 : (!quake.wire) -> !quake.wire
return
}

// CHECK-LABEL: func.func @red_button(
// CHECK-SAME: %[[VAL_0:.*]]: !quake.wire, %[[VAL_1:.*]]: !quake.wire) {
// CHECK: %[[VAL_2:.*]] = quake.h %[[VAL_0]] : (!quake.wire) -> !quake.wire
// CHECK: %[[VAL_3:.*]] = quake.reset %[[VAL_2]] : (!quake.wire) -> !quake.wire
// CHECK: return
// CHECK: }

0 comments on commit 6d777de

Please sign in to comment.