summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/constexpr-turing.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
committerdim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
commit952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch)
treedf8df0b0067b381eab470a3b8f28d14a552a6340 /test/SemaCXX/constexpr-turing.cpp
parentea266cad53e3d49771fa38103913d3ec7a166694 (diff)
downloadFreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip
FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/SemaCXX/constexpr-turing.cpp')
-rw-r--r--test/SemaCXX/constexpr-turing.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/SemaCXX/constexpr-turing.cpp b/test/SemaCXX/constexpr-turing.cpp
index 07c04ef..75aefbf 100644
--- a/test/SemaCXX/constexpr-turing.cpp
+++ b/test/SemaCXX/constexpr-turing.cpp
@@ -33,24 +33,24 @@ constexpr Tape move(const Tape &old, Dir dir) { return Tape(old, dir); }
// Run turing machine 'tm' on tape 'tape' from state 'state'. Return number of
// steps taken until halt.
constexpr unsigned run(const State *tm, const Tape &tape, unsigned state) {
- return state == halt ? 1 :
+ return state == halt ? 0 :
run(tm, move(update(tape, tm[state][tape.val].tape),
tm[state][tape.val].dir),
tm[state][tape.val].next) + 1;
}
-// 3-state busy beaver. 14 steps.
+// 3-state busy beaver. S(bb3) = 21.
constexpr State bb3[] = {
- { { true, R, 1 }, { true, L, 2 } },
- { { true, L, 0 }, { true, R, 1 } },
- { { true, L, 1 }, { true, R, halt } }
+ { { true, R, 1 }, { true, R, halt } },
+ { { true, L, 1 }, { false, R, 2 } },
+ { { true, L, 2 }, { true, L, 0 } }
};
-static_assert(run(bb3, Tape(), 0) == 14, "");
+static_assert(run(bb3, Tape(), 0) == 21, "");
-// 4-state busy beaver. 108 steps.
+// 4-state busy beaver. S(bb4) = 107.
constexpr State bb4[] = {
{ { true, R, 1 }, { true, L, 1 } },
{ { true, L, 0 }, { false, L, 2 } },
{ { true, R, halt }, { true, L, 3 } },
{ { true, R, 3 }, { false, R, 0 } } };
-static_assert(run(bb4, Tape(), 0) == 108, "");
+static_assert(run(bb4, Tape(), 0) == 107, "");
OpenPOWER on IntegriCloud