Merge branch 'master' of https://github.com/kripken/emscripten
This commit is contained in:
Коммит
d259c5e17e
1
AUTHORS
1
AUTHORS
|
@ -6,3 +6,4 @@ under the licensing terms detailed in LICENSE.
|
|||
* Max Shawabkeh <max99x@gmail.com>
|
||||
* Sigmund Vik <sigmund_vik@yahoo.com>
|
||||
* Jeff Terrace <jterrace@gmail.com>
|
||||
* Benoit Tremblay <benoit.tremblay@frimastudio.com>
|
|
@ -5415,9 +5415,7 @@ LibraryManager.library = {
|
|||
},
|
||||
|
||||
EMSCRIPTEN_COMMENT__inline: function(param) {
|
||||
if (param.indexOf('CHECK_OVERFLOW') >= 0) {
|
||||
param = param.split('(')[1].split(',')[0];
|
||||
}
|
||||
param = stripCorrections(param);
|
||||
return '// ' + Variables.globals[param].value.text.replace('\\00', '') + ' ';
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1382,3 +1382,17 @@ function finalizeBlockAddress(param) {
|
|||
return Functions.currFunctions[param.func].labelIds[param.label]; // XXX We rely on currFunctions here...?
|
||||
}
|
||||
|
||||
function stripCorrections(param) {
|
||||
var m;
|
||||
if (m = /^\((.*)\)$/.exec(param)) {
|
||||
param = m[1];
|
||||
}
|
||||
if (m = /^\((\w+)\)&\d+$/.exec(param)) {
|
||||
param = m[1];
|
||||
}
|
||||
if (m = /CHECK_OVERFLOW\(([^,)]*),.*/.exec(param)) {
|
||||
param = m[1];
|
||||
}
|
||||
return param;
|
||||
}
|
||||
|
||||
|
|
|
@ -103,11 +103,13 @@
|
|||
|
||||
/* Support gcc's __attribute__ facility. */
|
||||
|
||||
#ifndef _ATTRIBUTE /* XXX Emscripten */
|
||||
#ifdef __GNUC__
|
||||
#define _ATTRIBUTE(attrs) __attribute__ (attrs)
|
||||
#else
|
||||
#define _ATTRIBUTE(attrs)
|
||||
#endif
|
||||
#endif /* XXX Emscripten */
|
||||
|
||||
/* The traditional meaning of 'extern inline' for GCC is not
|
||||
to emit the function body unless the address is explicitly
|
||||
|
|
|
@ -302,7 +302,7 @@ int _EXFUN(unlinkat, (int, const char *, int));
|
|||
#define _SC_PRIORITIZED_IO 28
|
||||
#define _SC_REALTIME_SIGNALS 29
|
||||
#define _SC_SEMAPHORES 30
|
||||
#define _SC_SHARED_MEMORY_OBJECTS 31
|
||||
#define _SC_SHARED_MEMORY_OBJECTS 199 /* XXX Emscripten changed 31 to 199 */
|
||||
#define _SC_SYNCHRONIZED_IO 32
|
||||
#define _SC_TIMERS 33
|
||||
#define _SC_AIO_LISTIO_MAX 34
|
||||
|
@ -406,8 +406,6 @@ int _EXFUN(unlinkat, (int, const char *, int));
|
|||
#define _SC_THREAD_ROBUST_PRIO_INHERIT 122
|
||||
#define _SC_THREAD_ROBUST_PRIO_PROTECT 123
|
||||
#define _SC_XOPEN_UUCP 124
|
||||
/* XXX Emscripten */
|
||||
#define _SC_SHARED_MEMORY_OBJECTS 199
|
||||
|
||||
/*
|
||||
* pathconf values per IEEE Std 1003.1, 2008 Edition
|
||||
|
|
|
@ -317,7 +317,7 @@ public:
|
|||
_LIBCPP_INLINE_VISIBILITY bool bad() const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY iostate exceptions() const;
|
||||
_LIBCPP_INLINE_VISIBILITY void exceptions(iostate __except);
|
||||
_LIBCPP_INLINE_VISIBILITY void exceptions(iostate except); /* XXX Emscripten: renammed __except to except because it is a reserved keyword */
|
||||
|
||||
void __set_badbit_and_consider_rethrow();
|
||||
void __set_failbit_and_consider_rethrow();
|
||||
|
@ -553,9 +553,9 @@ ios_base::exceptions() const
|
|||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
ios_base::exceptions(iostate __except)
|
||||
ios_base::exceptions(iostate except) /* XXX Emscripten: renammed __except to except because it is a reserved keyword */
|
||||
{
|
||||
__exceptions_ = __except;
|
||||
__exceptions_ = except; /* XXX Emscripten: renammed __except to except because it is a reserved keyword */
|
||||
clear(__rdstate_);
|
||||
}
|
||||
|
||||
|
@ -584,7 +584,7 @@ public:
|
|||
_LIBCPP_ALWAYS_INLINE bool bad() const {return ios_base::bad();}
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE iostate exceptions() const {return ios_base::exceptions();}
|
||||
_LIBCPP_ALWAYS_INLINE void exceptions(iostate __except) {ios_base::exceptions(__except);}
|
||||
_LIBCPP_ALWAYS_INLINE void exceptions(iostate except) {ios_base::exceptions(except);} /* XXX Emscripten: renammed __except to except because it is a reserved keyword */
|
||||
|
||||
// 27.5.4.1 Constructor/destructor:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
|
|
|
@ -31,8 +31,11 @@ except:
|
|||
# Core test runner class, shared between normal tests and benchmarks
|
||||
|
||||
class RunnerCore(unittest.TestCase):
|
||||
save_dir = 0
|
||||
save_JS = 0
|
||||
|
||||
def setUp(self):
|
||||
if not Settings.save_dir:
|
||||
if not self.save_dir:
|
||||
dirname = tempfile.mkdtemp(prefix="ems_" + self.__class__.__name__ + "_", dir=TEMP_DIR)
|
||||
else:
|
||||
dirname = os.path.join(TEMP_DIR, 'tmp')
|
||||
|
@ -41,13 +44,13 @@ class RunnerCore(unittest.TestCase):
|
|||
self.working_dir = dirname
|
||||
|
||||
def tearDown(self):
|
||||
if Settings.save_JS:
|
||||
if self.save_JS:
|
||||
for name in os.listdir(self.get_dir()):
|
||||
if name.endswith(('.o.js', '.cc.js')):
|
||||
suff = '.'.join(name.split('.')[-2:])
|
||||
shutil.copy(os.path.join(self.get_dir(), name),
|
||||
os.path.join(TEMP_DIR, self.id().replace('__main__.', '').replace('.test_', '.')+'.'+suff))
|
||||
if not Settings.save_dir:
|
||||
if not self.save_dir:
|
||||
shutil.rmtree(self.get_dir())
|
||||
|
||||
def skip(self, why):
|
||||
|
@ -1418,7 +1421,7 @@ if 'benchmark' not in str(sys.argv):
|
|||
self.do_run(src, '*2,2,5,8,8***8,8,5,8,8***7,2,6,990,7,2*', [], lambda x: x.replace('\n', '*'))
|
||||
|
||||
def test_emscripten_api(self):
|
||||
if Settings.OPTIMIZE or Settings.RELOOP or LLVM_OPTS: return self.skip('FIXME')
|
||||
#if Settings.OPTIMIZE or Settings.RELOOP or LLVM_OPTS: return self.skip('FIXME')
|
||||
|
||||
src = '''
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -211,8 +211,6 @@ def read_auto_optimize_data(filename):
|
|||
class Dummy: pass
|
||||
|
||||
Settings = Dummy() # A global singleton. Not pretty, but nicer than passing |, settings| everywhere
|
||||
Settings.save_dir = 0
|
||||
Settings.save_JS = 0
|
||||
|
||||
# Building
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче