aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/snippets.js5
-rw-r--r--tests/runner.py2
-rw-r--r--tests/sauer/command.cpp9
3 files changed, 13 insertions, 3 deletions
diff --git a/src/snippets.js b/src/snippets.js
index 39160b78..96420990 100644
--- a/src/snippets.js
+++ b/src/snippets.js
@@ -63,6 +63,11 @@ var Snippets = {
} while (HEAP[psrc+i-1] != 0);
},
+ strtol: function(ptr) {
+ // XXX: We ignore the other two params!
+ return parseInt(Pointer_stringify(ptr));
+ },
+
strcmp: function(px, py) {
var i = 0;
while (true) {
diff --git a/tests/runner.py b/tests/runner.py
index b3be793e..e9ba880d 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -671,7 +671,7 @@ class T(unittest.TestCase):
# used, see Mozilla bug 593659.
assert PARSER_ENGINE != SPIDERMONKEY_ENGINE
# XXX RELOOP = 1 either is very very slow, or nonfinishing
- self.do_test(path_from_root(['tests', 'sauer']), 'Hello from sauer', main_file='command.cpp', emscripten_settings='{"RELOOP": 0}')
+ self.do_test(path_from_root(['tests', 'sauer']), '*Temp is 32\n9*', main_file='command.cpp', emscripten_settings='{"RELOOP": 0}')
if __name__ == '__main__':
if DEBUG: print "LLVM_GCC:", LLVM_GCC
diff --git a/tests/sauer/command.cpp b/tests/sauer/command.cpp
index 1037032f..0b0afc68 100644
--- a/tests/sauer/command.cpp
+++ b/tests/sauer/command.cpp
@@ -1402,10 +1402,15 @@ void fatal(const char *s, ...) // failure exit
exit(EXIT_FAILURE);
}
+VARP(somevar, 0, 0, 1024);
+
int main()
{
- execute("echo Hello from sauer");
-
+ execute("somevar 9");
+ execute("temp = (+ 22 $somevar)");
+ execute("if (> $temp 30) [ temp = (+ $temp 1) ] [ temp = (* $temp 2) ]");
+ execute("echo [*Temp is] $temp");
+ printf("%d*\n", getvar("somevar"));
return 0;
}