Skip to content

Commit 1b8d488

Browse files
committed
add MachineVerifier test
Signed-off-by: Nathan Gauër <[email protected]>
1 parent e1c20ee commit 1b8d488

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# RUN: llc -o - %s -mtriple=spirv-unknown-vulkan-compute -verify-machineinstrs -run-pass=none | FileCheck %s
2+
# REQUIRES: spirv-registered-target
3+
4+
# This should cleanly pass the machine verifier
5+
---
6+
# CHECK-LABEL: name: func0
7+
# CHECK: %7:id = OpPhi %1, %5, %bb.1, %6, %bb.2
8+
name: func0
9+
tracksRegLiveness: true
10+
noPhis: false
11+
body: |
12+
bb.0:
13+
%0:type = OpTypeBool
14+
%1:type = OpTypeInt 32, 0
15+
%2:iid = OpFunctionParameter %1
16+
%3:iid = OpFunctionParameter %1
17+
%4:iid = OpIEqual %0, %2, %3
18+
OpBranchConditional %4, %bb.1, %bb.2
19+
20+
bb.1:
21+
%5:iid = OpLoad %1, %2
22+
OpBranch %bb.3
23+
24+
bb.2:
25+
%6:iid = OpLoad %1, %3
26+
OpBranch %bb.3
27+
28+
bb.3:
29+
%7:id = OpPhi %1, %5, %bb.1, %6, %bb.2
30+
...
31+
---

0 commit comments

Comments
 (0)