aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xemcc29
-rwxr-xr-xemscripten.py2
-rw-r--r--src/library.js117
-rw-r--r--src/parseTools.js4
-rw-r--r--system/include/emscripten/emscripten.h6
-rw-r--r--tests/core/test_exceptions_alias.c15
-rw-r--r--tests/core/test_exceptions_alias.out2
-rw-r--r--tests/core/test_inlinejs3.in3
-rw-r--r--tests/core/test_longjmp_throw.cpp38
-rw-r--r--tests/core/test_longjmp_throw.out4
-rw-r--r--tests/poppler/utils/pdftoppm.cc5
-rw-r--r--tests/test_core.py30
-rw-r--r--tests/test_other.py8
-rw-r--r--tools/find_bigis.py2
-rw-r--r--tools/shared.py2
15 files changed, 217 insertions, 50 deletions
diff --git a/emcc b/emcc
index 1942be28..83ce4529 100755
--- a/emcc
+++ b/emcc
@@ -160,7 +160,8 @@ Options that are modified or new in %s include:
output.
-O3 As -O2, plus additional optimizations that can
- take a significant amount of compilation time.
+ take a significant amount of compilation time and/or
+ are relatively new.
For tips on optimizing your code, see
https://github.com/kripken/emscripten/wiki/Optimizing-Code
@@ -485,10 +486,13 @@ Options that are modified or new in %s include:
libraries, and after any link-time optimizations
(if any).
- --memory-init-file <on> If on, we generate a separate memory initialization
- file. This is more efficient than storing the
- memory initialization data embedded inside
- JavaScript as text. (default is off)
+ --memory-init-file <on> 0: Do not emit a separate memory initialization
+ file, keep the static initialization inside
+ the generated JavaScript as text (default)
+ 1: Emit a separate memory initialization file
+ in binary format. This is more efficient than
+ storing it as text inside JavaScript, but does
+ mean you have another file to publish.
-Wno-warn-absolute-paths If not specified, the compiler will warn about any
uses of absolute paths in -I and -L command line
@@ -1219,7 +1223,8 @@ try:
assert not shared.Settings.PGO, 'cannot run PGO in ASM_JS mode'
if shared.Settings.SAFE_HEAP and not js_opts:
- logging.warning('asm.js+SAFE_HEAP requires js opts to be run (-O1 or above by default)')
+ js_opts = True
+ logging.warning('enabling js opts to allow SAFE_HEAP to work properly')
if shared.Settings.ALLOW_MEMORY_GROWTH:
logging.error('Cannot enable ALLOW_MEMORY_GROWTH with asm.js, build with -s ASM_JS=0 if you need a growable heap');
@@ -1994,12 +1999,12 @@ try:
else:
return 'eliminate'
- js_optimizer_queue += [get_eliminate()]
+ if opt_level >= 2:
+ js_optimizer_queue += [get_eliminate()]
- if shared.Settings.AGGRESSIVE_VARIABLE_ELIMINATION:
- js_optimizer_queue += ['aggressiveVariableElimination']
+ if shared.Settings.AGGRESSIVE_VARIABLE_ELIMINATION:
+ js_optimizer_queue += ['aggressiveVariableElimination']
- if opt_level >= 2:
js_optimizer_queue += ['simplifyExpressions']
if closure and not shared.Settings.ASM_JS:
@@ -2018,13 +2023,13 @@ try:
js_optimizer_queue += ['outline']
js_optimizer_extra_info['sizeToOutline'] = shared.Settings.OUTLINING_LIMIT
- if (not closure or shared.Settings.ASM_JS) and shared.Settings.RELOOP and debug_level < 3:
+ if opt_level >= 2 and (not closure or shared.Settings.ASM_JS) and shared.Settings.RELOOP and debug_level < 3:
if shared.Settings.ASM_JS and opt_level >= 3 and shared.Settings.OUTLINING_LIMIT == 0:
js_optimizer_queue += ['registerizeHarder']
else:
js_optimizer_queue += ['registerize']
- if opt_level > 0:
+ if opt_level >= 2:
if debug_level < 2 and shared.Settings.ASM_JS: js_optimizer_queue += ['minifyNames']
if debug_level == 0: js_optimizer_queue += ['minifyWhitespace']
diff --git a/emscripten.py b/emscripten.py
index 725f573f..ce929858 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -1204,7 +1204,7 @@ Runtime.stackRestore = function(top) { asm['stackRestore'](top) };
if DEBUG: logging.debug(' emscript: final python processing took %s seconds' % (time.time() - t))
-if os.environ.get('EMCC_FAST_COMPILER'):
+if os.environ.get('EMCC_FAST_COMPILER') == '1':
emscript = emscript_fast
def main(args, compiler_engine, cache, jcache, relooper, temp_files, DEBUG, DEBUG_CACHE):
diff --git a/src/library.js b/src/library.js
index fc2e8a64..4c0f790f 100644
--- a/src/library.js
+++ b/src/library.js
@@ -162,7 +162,7 @@ LibraryManager.library = {
if (times) {
// NOTE: We don't keep track of access timestamps.
var offset = {{{ C_STRUCTS.utimbuf.modtime }}};
- time = {{{ makeGetValue('times', 'offset', 'i32') }}}
+ time = {{{ makeGetValue('times', 'offset', 'i32') }}};
time *= 1000;
} else {
time = Date.now();
@@ -1182,7 +1182,7 @@ LibraryManager.library = {
for (var i = 0; i < length; i++) {
{{{ makeSetValue('buf', 'i', 'value.charCodeAt(i)', 'i8') }}};
}
- if (len > length) {{{ makeSetValue('buf', 'i++', '0', 'i8') }}}
+ if (len > length) {{{ makeSetValue('buf', 'i++', '0', 'i8') }}};
return i;
}
},
@@ -3229,22 +3229,34 @@ LibraryManager.library = {
strtoll: function(str, endptr, base) {
return __parseInt64(str, endptr, base, '-9223372036854775808', '9223372036854775807'); // LLONG_MIN, LLONG_MAX.
},
- strtoll_l: 'strtoll', // no locale support yet
+ strtoll_l__deps: ['strtoll'],
+ strtoll_l: function(str, endptr, base) {
+ return _strtoll(str, endptr, base); // no locale support yet
+ },
strtol__deps: ['_parseInt'],
strtol: function(str, endptr, base) {
return __parseInt(str, endptr, base, -2147483648, 2147483647, 32); // LONG_MIN, LONG_MAX.
},
- strtol_l: 'strtol', // no locale support yet
+ strtol_l__deps: ['strtol'],
+ strtol_l: function(str, endptr, base) {
+ return _strtol(str, endptr, base); // no locale support yet
+ },
strtoul__deps: ['_parseInt'],
strtoul: function(str, endptr, base) {
return __parseInt(str, endptr, base, 0, 4294967295, 32, true); // ULONG_MAX.
},
- strtoul_l: 'strtoul', // no locale support yet
+ strtoul_l__deps: ['strtoul'],
+ strtoul_l: function(str, endptr, base) {
+ return _strtoul(str, endptr, base); // no locale support yet
+ },
strtoull__deps: ['_parseInt64'],
strtoull: function(str, endptr, base) {
return __parseInt64(str, endptr, base, 0, '18446744073709551615', true); // ULONG_MAX.
},
- strtoull_l: 'strtoull', // no locale support yet
+ strtoull_l__deps: ['strtoull'],
+ strtoull_l: function(str, endptr, base) {
+ return _strtoull(str, endptr, base); // no locale support yet
+ },
atoi__deps: ['strtol'],
atoi: function(ptr) {
@@ -3735,7 +3747,10 @@ LibraryManager.library = {
},
// We always assume ASCII locale.
strcoll: 'strcmp',
- strcoll_l: 'strcmp',
+ strcoll_l__deps: ['strcoll'],
+ strcoll_l: function(px, py) {
+ return _strcoll(px, py); // no locale support yet
+ },
strcasecmp__asm: true,
strcasecmp__sig: 'iii',
@@ -4000,7 +4015,10 @@ LibraryManager.library = {
}
},
_toupper: 'toupper',
- toupper_l: 'toupper',
+ toupper_l__deps: ['toupper'],
+ toupper_l: function(str, endptr, base) {
+ return _toupper(str, endptr, base); // no locale support yet
+ },
tolower__asm: true,
tolower__sig: 'ii',
@@ -4011,65 +4029,104 @@ LibraryManager.library = {
return (chr - {{{ charCode('A') }}} + {{{ charCode('a') }}})|0;
},
_tolower: 'tolower',
- tolower_l: 'tolower',
+ tolower_l__deps: ['tolower'],
+ tolower_l: function(chr) {
+ return _tolower(chr); // no locale support yet
+ },
// The following functions are defined as macros in glibc.
islower: function(chr) {
return chr >= {{{ charCode('a') }}} && chr <= {{{ charCode('z') }}};
},
- islower_l: 'islower',
+ islower_l__deps: ['islower'],
+ islower_l: function(chr) {
+ return _islower(chr); // no locale support yet
+ },
isupper: function(chr) {
return chr >= {{{ charCode('A') }}} && chr <= {{{ charCode('Z') }}};
},
- isupper_l: 'isupper',
+ isupper_l__deps: ['isupper'],
+ isupper_l: function(chr) {
+ return _isupper(chr); // no locale support yet
+ },
isalpha: function(chr) {
return (chr >= {{{ charCode('a') }}} && chr <= {{{ charCode('z') }}}) ||
(chr >= {{{ charCode('A') }}} && chr <= {{{ charCode('Z') }}});
},
- isalpha_l: 'isalpha',
+ isalpha_l__deps: ['isalpha'],
+ isalpha_l: function(chr) {
+ return _isalpha(chr); // no locale support yet
+ },
isdigit: function(chr) {
return chr >= {{{ charCode('0') }}} && chr <= {{{ charCode('9') }}};
},
- isdigit_l: 'isdigit',
+ isdigit_l__deps: ['isdigit'],
+ isdigit_l: function(chr) {
+ return _isdigit(chr); // no locale support yet
+ },
isxdigit: function(chr) {
return (chr >= {{{ charCode('0') }}} && chr <= {{{ charCode('9') }}}) ||
(chr >= {{{ charCode('a') }}} && chr <= {{{ charCode('f') }}}) ||
(chr >= {{{ charCode('A') }}} && chr <= {{{ charCode('F') }}});
},
- isxdigit_l: 'isxdigit',
+ isxdigit_l__deps: ['isxdigit'],
+ isxdigit_l: function(chr) {
+ return _isxdigit(chr); // no locale support yet
+ },
isalnum: function(chr) {
return (chr >= {{{ charCode('0') }}} && chr <= {{{ charCode('9') }}}) ||
(chr >= {{{ charCode('a') }}} && chr <= {{{ charCode('z') }}}) ||
(chr >= {{{ charCode('A') }}} && chr <= {{{ charCode('Z') }}});
},
- isalnum_l: 'isalnum',
+ isalnum_l__deps: ['isalnum'],
+ isalnum_l: function(chr) {
+ return _isalnum(chr); // no locale support yet
+ },
ispunct: function(chr) {
return (chr >= {{{ charCode('!') }}} && chr <= {{{ charCode('/') }}}) ||
(chr >= {{{ charCode(':') }}} && chr <= {{{ charCode('@') }}}) ||
(chr >= {{{ charCode('[') }}} && chr <= {{{ charCode('`') }}}) ||
(chr >= {{{ charCode('{') }}} && chr <= {{{ charCode('~') }}});
},
- ispunct_l: 'ispunct',
+ ispunct_l__deps: ['ispunct'],
+ ispunct_l: function(chr) {
+ return _ispunct(chr); // no locale support yet
+ },
isspace: function(chr) {
return (chr == 32) || (chr >= 9 && chr <= 13);
},
- isspace_l: 'isspace',
+ isspace_l__deps: ['isspace'],
+ isspace_l: function(chr) {
+ return _isspace(chr); // no locale support yet
+ },
isblank: function(chr) {
return chr == {{{ charCode(' ') }}} || chr == {{{ charCode('\t') }}};
},
- isblank_l: 'isblank',
+ isblank_l__deps: ['isblank'],
+ isblank_l: function(chr) {
+ return _isblank(chr); // no locale support yet
+ },
iscntrl: function(chr) {
return (0 <= chr && chr <= 0x1F) || chr === 0x7F;
},
- iscntrl_l: 'iscntrl',
+ iscntrl_l__deps: ['iscntrl'],
+ iscntrl_l: function(chr) {
+ return _iscntrl(chr); // no locale support yet
+ },
isprint: function(chr) {
return 0x1F < chr && chr < 0x7F;
},
- isprint_l: 'isprint',
+ isprint_l__deps: ['isprint'],
+ isprint_l: function(chr) {
+ return _isprint(chr); // no locale support yet
+ },
isgraph: function(chr) {
return 0x20 < chr && chr < 0x7F;
},
- isgraph_l: 'isgraph',
+ isgraph_l__deps: ['isgraph'],
+ isgraph_l: function(chr) {
+ return _isgraph(chr); // no locale support yet
+ },
// Lookup tables for glibc ctype implementation.
__ctype_b_loc: function() {
// http://refspecs.freestandards.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/baselib---ctype-b-loc.html
@@ -4365,8 +4422,8 @@ LibraryManager.library = {
Module.printErr('Compiled code throwing an exception, ' + [ptr,type,destructor] + ', at ' + stackTrace());
#endif
var header = ptr - ___cxa_exception_header_size;
- {{{ makeSetValue('header', 0, 'type', 'void*') }}}
- {{{ makeSetValue('header', 4, 'destructor', 'void*') }}}
+ {{{ makeSetValue('header', 0, 'type', 'void*') }}};
+ {{{ makeSetValue('header', 4, 'destructor', 'void*') }}};
___cxa_last_thrown_exception = ptr;
if (!("uncaught_exception" in __ZSt18uncaught_exceptionv)) {
__ZSt18uncaught_exceptionv.uncaught_exception = 1;
@@ -4434,7 +4491,7 @@ LibraryManager.library = {
var destructor = {{{ makeGetValue('header', 4, 'void*') }}};
if (destructor) {
Runtime.dynCall('vi', destructor, [ptr]);
- {{{ makeSetValue('header', 4, '0', 'i32') }}}
+ {{{ makeSetValue('header', 4, '0', 'i32') }}};
}
___cxa_free_exception(ptr);
___cxa_last_thrown_exception = 0;
@@ -5887,7 +5944,10 @@ LibraryManager.library = {
writeArrayToMemory(bytes, s);
return bytes.length-1;
},
- strftime_l: 'strftime', // no locale support yet
+ strftime_l__deps: ['strftime'],
+ strftime_l: function(s, maxsize, format, tm) {
+ return _strftime(s, maxsize, format, tm); // no locale support yet
+ },
strptime__deps: ['_isLeapYear', '_arraySum', '_addDays', '_MONTH_DAYS_REGULAR', '_MONTH_DAYS_LEAP'],
strptime: function(buf, format, tm) {
@@ -6129,7 +6189,10 @@ LibraryManager.library = {
return 0;
},
- strptime_l: 'strptime', // no locale support yet
+ strptime_l__deps: ['strptime'],
+ strptime_l: function(buf, format, tm) {
+ return _strptime(buf, format, tm); // no locale support yet
+ },
getdate: function(string) {
// struct tm *getdate(const char *string);
@@ -7630,7 +7693,7 @@ LibraryManager.library = {
node = DNS.lookup_name(node);
addr = __inet_pton4_raw(node);
if (family === {{{ cDefine('AF_UNSPEC') }}}) {
- family = {{{ cDefine('AF_INET') }}}
+ family = {{{ cDefine('AF_INET') }}};
} else if (family === {{{ cDefine('AF_INET6') }}}) {
addr = [0, 0, _htonl(0xffff), addr];
}
diff --git a/src/parseTools.js b/src/parseTools.js
index e09cd2e2..bad080b7 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -1332,7 +1332,7 @@ function makeGetValue(ptr, pos, type, noNeedFirst, unsigned, ignore, align, noSa
if (printType !== 'null' && printType[0] !== '#') printType = '"' + safeQuote(printType) + '"';
if (printType[0] === '#') printType = printType.substr(1);
if (ASM_JS) {
- if (!ignore) return asmCoercion('SAFE_HEAP_LOAD(' + asmCoercion(offset, 'i32') + ', ' + Runtime.getNativeTypeSize(type) + ', ' + ((type in Runtime.FLOAT_TYPES)|0) + ', ' + (!!unsigned+0) + ')', type);
+ if (!ignore && phase !== 'funcs') return asmCoercion('SAFE_HEAP_LOAD(' + asmCoercion(offset, 'i32') + ', ' + Runtime.getNativeTypeSize(type) + ', ' + ((type in Runtime.FLOAT_TYPES)|0) + ', ' + (!!unsigned+0) + ')', type);
// else fall through
} else {
return asmCoercion('SAFE_HEAP_LOAD(' + offset + ', ' + (ASM_JS ? 0 : printType) + ', ' + (!!unsigned+0) + ', ' + ((!checkSafeHeap() || ignore)|0) + ')', type);
@@ -1444,7 +1444,7 @@ function makeSetValue(ptr, pos, value, type, noNeedFirst, ignore, align, noSafe,
if (printType !== 'null' && printType[0] !== '#') printType = '"' + safeQuote(printType) + '"';
if (printType[0] === '#') printType = printType.substr(1);
if (ASM_JS) {
- if (!ignore) return asmCoercion('SAFE_HEAP_STORE(' + asmCoercion(offset, 'i32') + ', ' + asmCoercion(value, type) + ', ' + Runtime.getNativeTypeSize(type) + ', ' + ((type in Runtime.FLOAT_TYPES)|0) + ')', type);
+ if (!ignore && phase !== 'funcs') return asmCoercion('SAFE_HEAP_STORE(' + asmCoercion(offset, 'i32') + ', ' + asmCoercion(value, type) + ', ' + Runtime.getNativeTypeSize(type) + ', ' + ((type in Runtime.FLOAT_TYPES)|0) + ')', type);
// else fall through
} else {
return 'SAFE_HEAP_STORE(' + offset + ', ' + value + ', ' + (ASM_JS ? 0 : printType) + ', ' + ((!checkSafeHeap() || ignore)|0) + ')';
diff --git a/system/include/emscripten/emscripten.h b/system/include/emscripten/emscripten.h
index fb456d67..2fc82f50 100644
--- a/system/include/emscripten/emscripten.h
+++ b/system/include/emscripten/emscripten.h
@@ -50,10 +50,14 @@ extern "C" {
* return $0 + $1;
* }, calc(), otherCalc());
*
- * Note the {,}
+ * Note the { and }. If you just want to receive an output value
+ * (int or double) but *not* to pass any values, you can use
+ * EM_ASM_INT_V and EM_ASM_DOUBLE_V respectively.
*/
#define EM_ASM_INT(code, ...) emscripten_asm_const_int(#code, __VA_ARGS__)
#define EM_ASM_DOUBLE(code, ...) emscripten_asm_const_double(#code, __VA_ARGS__)
+#define EM_ASM_INT_V(code) emscripten_asm_const_int(#code)
+#define EM_ASM_DOUBLE_V(code) emscripten_asm_const_double(#code)
/*
* Forces LLVM to not dead-code-eliminate a function. Note that
diff --git a/tests/core/test_exceptions_alias.c b/tests/core/test_exceptions_alias.c
new file mode 100644
index 00000000..0c8cc37a
--- /dev/null
+++ b/tests/core/test_exceptions_alias.c
@@ -0,0 +1,15 @@
+#define _POSIX_SOURCE
+#include <locale.h>
+#include <ctype.h>
+#include <stdio.h>
+
+int main(void) {
+ try {
+ printf("*%i*\n", isdigit('0'));
+ printf("*%i*\n", isdigit_l('0', LC_GLOBAL_LOCALE));
+ }
+ catch (...) {
+ printf("EXCEPTION!\n");
+ }
+}
+
diff --git a/tests/core/test_exceptions_alias.out b/tests/core/test_exceptions_alias.out
new file mode 100644
index 00000000..2f67e501
--- /dev/null
+++ b/tests/core/test_exceptions_alias.out
@@ -0,0 +1,2 @@
+*1*
+*1*
diff --git a/tests/core/test_inlinejs3.in b/tests/core/test_inlinejs3.in
index e21ed041..9ddd5907 100644
--- a/tests/core/test_inlinejs3.in
+++ b/tests/core/test_inlinejs3.in
@@ -15,6 +15,9 @@ int main(int argc, char **argv) {
},
i, double(i) / 12);
}
+ EM_ASM_INT({ globalVar = $0 }, sum); // no outputs, just input
+ sum = 0;
+ sum = EM_ASM_INT_V({ return globalVar }); // no inputs, just output
printf("sum: %d\n", sum);
return 0;
}
diff --git a/tests/core/test_longjmp_throw.cpp b/tests/core/test_longjmp_throw.cpp
new file mode 100644
index 00000000..a5b658e8
--- /dev/null
+++ b/tests/core/test_longjmp_throw.cpp
@@ -0,0 +1,38 @@
+#include <stdio.h>
+#include <setjmp.h>
+
+static jmp_buf buf;
+volatile int x = 0;
+
+void second(void) {
+ printf("second\n");
+ if (x == 17) throw 5;
+ else longjmp(buf, -1);
+}
+
+void first(void) {
+ printf("first\n");
+ longjmp(buf, 1);
+}
+
+int main() {
+ int jmpval = setjmp(buf);
+ if (!jmpval) {
+ x++;
+ first();
+ printf("skipped\n");
+ } else if (jmpval == 1) {
+ printf("result: %d %d\n", x, jmpval);
+ x++;
+ try {
+ second();
+ } catch(int a) {
+ x--;
+ second();
+ }
+ } else if (jmpval == -1) {
+ printf("result: %d %d\n", x, jmpval);
+ }
+
+ return 0;
+}
diff --git a/tests/core/test_longjmp_throw.out b/tests/core/test_longjmp_throw.out
new file mode 100644
index 00000000..e9cc7525
--- /dev/null
+++ b/tests/core/test_longjmp_throw.out
@@ -0,0 +1,4 @@
+first
+result: 1 1
+second
+result: 2 -1
diff --git a/tests/poppler/utils/pdftoppm.cc b/tests/poppler/utils/pdftoppm.cc
index f600e5ba..4df0f5d8 100644
--- a/tests/poppler/utils/pdftoppm.cc
+++ b/tests/poppler/utils/pdftoppm.cc
@@ -183,6 +183,10 @@ static void savePageSlice(PDFDoc *doc,
bitmap->writePNMFile(ppmFile);
}
} else {
+#if EMSCRIPTEN // XXX EMSCRIPTEN: avoid writing to stdout, better for benchmarking
+ printf("avoiding writing to stdout\n");
+#else
+
#ifdef _WIN32
setmode(fileno(stdout), O_BINARY);
#endif
@@ -194,6 +198,7 @@ static void savePageSlice(PDFDoc *doc,
} else {
bitmap->writePNMFile(stdout);
}
+#endif
}
}
diff --git a/tests/test_core.py b/tests/test_core.py
index 97cba68f..ad35178c 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1157,6 +1157,16 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
src, output = (test_path + s for s in ('.in', '.out'))
self.do_run_from_file(src, output)
+ def test_longjmp_throw(self):
+ if self.run_name == 'asm3': return self.skip('issue 2069') # FIXME
+
+ for disable_throw in [0, 1]:
+ print disable_throw
+ Settings.DISABLE_EXCEPTION_CATCHING = disable_throw
+ test_path = path_from_root('tests', 'core', 'test_longjmp_throw')
+ src, output = (test_path + s for s in ('.cpp', '.out'))
+ self.do_run_from_file(src, output)
+
def test_setjmp_many(self):
if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp: make MAX_SETJMPS take effect')
@@ -1266,12 +1276,16 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
def test_exceptions_2(self):
if self.emcc_args is None: return self.skip('need emcc to add in libcxx properly')
- Settings.DISABLE_EXCEPTION_CATCHING = 0
+ if self.run_name == 'asm2x86': return self.skip('TODO')
- test_path = path_from_root('tests', 'core', 'test_exceptions_2')
- src, output = (test_path + s for s in ('.in', '.out'))
+ Settings.DISABLE_EXCEPTION_CATCHING = 0
- self.do_run_from_file(src, output)
+ for safe in [0,1]:
+ print safe
+ Settings.SAFE_HEAP = safe
+ test_path = path_from_root('tests', 'core', 'test_exceptions_2')
+ src, output = (test_path + s for s in ('.in', '.out'))
+ self.do_run_from_file(src, output)
def test_exceptions_white_list(self):
if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
@@ -1352,6 +1366,12 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
self.do_run_from_file(src, output)
+ def test_exceptions_alias(self):
+ Settings.DISABLE_EXCEPTION_CATCHING = 0
+ test_path = path_from_root('tests', 'core', 'test_exceptions_alias')
+ src, output = (test_path + s for s in ('.c', '.out'))
+ self.do_run_from_file(src, output)
+
def test_async_exit(self):
open('main.c', 'w').write(r'''
#include <stdio.h>
@@ -5082,7 +5102,7 @@ def process(filename):
'structparam', 'uadd_overflow_ta2', 'extendedprecision', 'issue_39', 'emptystruct', 'phinonexist', 'quotedlabel', 'oob_ta2', 'phientryimplicit', 'phiself', 'invokebitcast', # invalid ir
'structphiparam', 'callwithstructural_ta2', 'callwithstructural64_ta2', 'structinparam', # pnacl limitations in ExpandStructRegs
'2xi40', # pnacl limitations in ExpandGetElementPtr
- 'legalizer_ta2', '514_ta2', # pnacl limitation in not legalizing i104, i96, etc.
+ 'legalizer_ta2', # pnacl limitation in not legalizing i104, i96, etc.
'indirectbrphi', 'ptrtoint_blockaddr', 'quoted', # current fastcomp limitations FIXME
'sillyfuncast2', 'sillybitcast', 'atomicrmw_unaligned' # TODO XXX
]: continue
diff --git a/tests/test_other.py b/tests/test_other.py
index 74507c21..bc05826e 100644
--- a/tests/test_other.py
+++ b/tests/test_other.py
@@ -2343,3 +2343,11 @@ int main() {
output = run_js(self.in_dir('a.out.js'), stderr=PIPE, full_output=True, engine=NODE_JS)
assert '|5|' in output, output
+ # also verify that the gch is actually used
+ err = Popen([PYTHON, EMCC, 'src.cpp', '-include', 'header.h', '-Xclang', '-print-stats'], stderr=PIPE).communicate()
+ assert '*** PCH/Modules Loaded:\nModule: header.h.gch' in err[1], err[1]
+ # and sanity check it is not mentioned when not
+ try_delete('header.h.gch')
+ err = Popen([PYTHON, EMCC, 'src.cpp', '-include', 'header.h', '-Xclang', '-print-stats'], stderr=PIPE).communicate()
+ assert '*** PCH/Modules Loaded:\nModule: header.h.gch' not in err[1], err[1]
+
diff --git a/tools/find_bigis.py b/tools/find_bigis.py
index d11c1a81..1261e7ff 100644
--- a/tools/find_bigis.py
+++ b/tools/find_bigis.py
@@ -6,7 +6,7 @@ import os, sys, re
filename = sys.argv[1]
data = open(filename).read()
-iss = re.findall('[^%]i\d+ [^=]', data)
+iss = re.findall(' i\d+ [^=]', data)
set_iss = set(iss)
bigs = []
for iss in set_iss:
diff --git a/tools/shared.py b/tools/shared.py
index f88eace0..bd1d1bee 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -345,7 +345,7 @@ def find_temp_directory():
# we re-check sanity when the settings are changed)
# We also re-check sanity and clear the cache when the version changes
-EMSCRIPTEN_VERSION = '1.9.5'
+EMSCRIPTEN_VERSION = '1.10.0'
def generate_sanity():
return EMSCRIPTEN_VERSION + '|' + get_llvm_target() + '|' + LLVM_ROOT + '|' + get_clang_version()