diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-08-16 11:39:04 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-08-16 11:39:04 -0700 |
commit | ab6452296324f9827b07780c90847a69f2173ed8 (patch) | |
tree | 0e24becd8f51e8192e4b01f8ad8a7a0eddbc64e3 /tests | |
parent | 52f2d45d070342b82dee9fcac325b8535f3adc65 (diff) |
generate separate function table wrappers for a single library function aliased with different signatures
Diffstat (limited to 'tests')
-rw-r--r-- | tests/aniso.c | 10 | ||||
-rw-r--r-- | tests/test_browser.py | 6 |
2 files changed, 14 insertions, 2 deletions
diff --git a/tests/aniso.c b/tests/aniso.c index 1126265e..f210e5a5 100644 --- a/tests/aniso.c +++ b/tests/aniso.c @@ -161,7 +161,7 @@ int main(int argc, char *argv[]) for (int x = 0; x < n; x++) { int start = x*w*2; glBegin( GL_TRIANGLES ); - glTexCoord2i( 1, 0 ); glVertex3f( start , 0, 0 ); + glTexCoord2i( 1, 0 ); glVertex2i( start , 0 ); glTexCoord2i( 0, 0 ); glVertex3f( start+w, 300, 0 ); glTexCoord2i( 1, 1 ); glVertex3f( start-w, 300, 0 ); glEnd(); @@ -209,5 +209,11 @@ int main(int argc, char *argv[]) SDL_Quit(); - return 0; + // check for asm compilation bug with aliased functions with different sigs + void (*f)(int, int) = glVertex2i; + if ((int)f % 16 == 4) f(5, 7); + void (*g)(int, int) = glVertex3f; + if ((int)g % 16 == 4) g(5, 7); + return (int)f + (int)g; } + diff --git a/tests/test_browser.py b/tests/test_browser.py index cd5668a3..323677ba 100644 --- a/tests/test_browser.py +++ b/tests/test_browser.py @@ -1323,6 +1323,12 @@ Press any key to continue.''' self.btest('s3tc_crunch.c', reference='s3tc_crunch.png', reference_slack=11, args=['--pre-js', 'asset_a.js', '--pre-js', 'asset_b.js', '-s', 'LEGACY_GL_EMULATION=1']) def test_aniso(self): + if SPIDERMONKEY_ENGINE in JS_ENGINES: + # asm.js-ification check + Popen([PYTHON, EMCC, path_from_root('tests', 'aniso.c'), '-O2', '-g2', '-s', 'LEGACY_GL_EMULATION=1']).communicate() + Settings.ASM_JS = 1 + self.run_generated_code(SPIDERMONKEY_ENGINE, 'a.out.js') + shutil.copyfile(path_from_root('tests', 'water.dds'), 'water.dds') self.btest('aniso.c', reference='aniso.png', reference_slack=2, args=['--preload-file', 'water.dds', '-s', 'LEGACY_GL_EMULATION=1']) |