aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/regalloc_test.go
diff options
context:
space:
mode:
authorGerrit Code Review <noreply-gerritcodereview@google.com>2016-03-01 21:36:45 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-03-01 21:36:45 +0000
commita6fb2aede7c8d47b4d913eb83fa45bbeca76c433 (patch)
tree1dd5039e5515959a8d162fbdac964663dd2ec778 /src/cmd/compile/internal/ssa/regalloc_test.go
parent998aaf8a64b7d90269815a2ae9d778da519d0a87 (diff)
parent9d854fd44ae669f60c15133a4d2ce407ea2bccc4 (diff)
downloadgo-a6fb2aede7c8d47b4d913eb83fa45bbeca76c433.tar.xz
Merge "Merge branch 'dev.ssa' into mergebranch"
Diffstat (limited to 'src/cmd/compile/internal/ssa/regalloc_test.go')
-rw-r--r--src/cmd/compile/internal/ssa/regalloc_test.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/regalloc_test.go b/src/cmd/compile/internal/ssa/regalloc_test.go
new file mode 100644
index 0000000000..6f3f690f1e
--- /dev/null
+++ b/src/cmd/compile/internal/ssa/regalloc_test.go
@@ -0,0 +1,33 @@
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ssa
+
+import "testing"
+
+func TestLiveControlOps(t *testing.T) {
+ c := testConfig(t)
+ f := Fun(c, "entry",
+ Bloc("entry",
+ Valu("mem", OpInitMem, TypeMem, 0, nil),
+ Valu("x", OpAMD64MOVBconst, TypeInt8, 1, nil),
+ Valu("y", OpAMD64MOVBconst, TypeInt8, 2, nil),
+ Valu("a", OpAMD64TESTB, TypeFlags, 0, nil, "x", "y"),
+ Valu("b", OpAMD64TESTB, TypeFlags, 0, nil, "y", "x"),
+ Eq("a", "if", "exit"),
+ ),
+ Bloc("if",
+ Eq("b", "plain", "exit"),
+ ),
+ Bloc("plain",
+ Goto("exit"),
+ ),
+ Bloc("exit",
+ Exit("mem"),
+ ),
+ )
+ flagalloc(f.f)
+ regalloc(f.f)
+ checkFunc(f.f)
+}