aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-05-31 14:39:18 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-05-31 14:39:18 -0700
commit358260eefc7cfc3571d9bf6b26e26c74c77f57e0 (patch)
treee114e23b037e1364b033d9c69df89430fdaaf425 /tests/runner.py
parent89511656efa293c3d64d42b85d344483e4ab3756 (diff)
parent60766db449b7ceef9a5f0fecde2b2abf146b5926 (diff)
Merge pull request #460 from adetaylor/llvm_uadd_with_overflow_i16
Adding LLVM intrinsic llvm_uadd_with_overflow_i16.
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index ce19aadb..dcb3632f 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -950,6 +950,31 @@ m_divisor is 1091269979
'''
self.do_run(src, 'zero 2, 104', ['hallo'])
+ def test_i16_emcc_intrinsic(self):
+ Settings.CORRECT_SIGNS = 1 # Relevant to this test
+
+ src = r'''
+ #include <stdio.h>
+
+ int test(unsigned short a, unsigned short b) {
+ unsigned short result = a;
+ result += b;
+ if (result < b) printf("C!");
+ return result;
+ }
+
+ int main(void) {
+ printf(",%d,", test(0, 0));
+ printf(",%d,", test(1, 1));
+ printf(",%d,", test(65535, 1));
+ printf(",%d,", test(1, 65535));
+ printf(",%d,", test(32768, 32767));
+ printf(",%d,", test(32768, 32768));
+ return 0;
+ }
+ '''
+ self.do_run(src, ',0,,2,C!,0,C!,0,,65535,C!,0,')
+
def test_sha1(self):
if self.emcc_args == None: return self.skip('needs ta2')