From eb366fcd412d67a751ac945dbb352731a0024de9 Mon Sep 17 00:00:00 2001 From: Jan Jongboom Date: Wed, 25 Mar 2015 09:36:38 +0100 Subject: [PATCH 01/10] Allow writing to MEMFS through mmap by implementing msync --- src/library.js | 18 +++++- src/library_fs.js | 9 +++ src/library_memfs.js | 16 +++++- tests/fs/test_mmap.c | 123 +++++++++++++++++++++++++++++++++++++++++ tests/fs/test_mmap.out | 3 + tests/test_core.py | 9 +++ 6 files changed, 175 insertions(+), 3 deletions(-) create mode 100644 tests/fs/test_mmap.c create mode 100644 tests/fs/test_mmap.out diff --git a/src/library.js b/src/library.js index c55e511f919a9..ddba8d62a19df 100644 --- a/src/library.js +++ b/src/library.js @@ -2568,7 +2568,7 @@ LibraryManager.library = { } } - _mmap.mappings[ptr] = { malloc: ptr, num: num, allocated: allocated }; + _mmap.mappings[ptr] = { malloc: ptr, num: num, allocated: allocated, fd: fd, flags: flags }; return ptr; }, @@ -2578,6 +2578,13 @@ LibraryManager.library = { var info = _mmap.mappings[start]; if (!info) return 0; if (num == info.num) { + // At the Linux man page, it says: + // "The file may not actually be updated until msync(2) or munmap(2) are called." + // I guess that means we need to call msync when doing munmap + _msync(start, num); // todo: which flags? + + FS.munmap(FS.getStream(info.fd)); + _mmap.mappings[start] = null; if (info.allocated) { _free(info.malloc); @@ -2598,7 +2605,14 @@ LibraryManager.library = { msync: function(addr, len, flags) { // int msync(void *addr, size_t len, int flags); // http://pubs.opengroup.org/onlinepubs/009696799/functions/msync.html - // Pretend to succeed + // TODO: support sync'ing parts of allocations + var info = _mmap.mappings[addr]; + if (!info) return 0; + if (len == info.num) { + var buffer = new Uint8Array(HEAPU8.buffer, addr, len); + return FS.msync(FS.getStream(info.fd), buffer, 0, len, info.flags); + } + return 0; }, diff --git a/src/library_fs.js b/src/library_fs.js index 95b5cf19b51ec..771bd1f71fa68 100644 --- a/src/library_fs.js +++ b/src/library_fs.js @@ -1154,6 +1154,15 @@ mergeInto(LibraryManager.library, { } return stream.stream_ops.mmap(stream, buffer, offset, length, position, prot, flags); }, + msync: function(stream, buffer, offset, length, mmapFlags) { + if (!stream.stream_ops.msync) { + return 0; + } + return stream.stream_ops.msync(stream, buffer, offset, length, mmapFlags); + }, + munmap: function(stream) { + return 0; + }, ioctl: function(stream, cmd, arg) { if (!stream.stream_ops.ioctl) { throw new FS.ErrnoError(ERRNO_CODES.ENOTTY); diff --git a/src/library_memfs.js b/src/library_memfs.js index ca189918d9fcc..162d390b48c69 100644 --- a/src/library_memfs.js +++ b/src/library_memfs.js @@ -38,7 +38,8 @@ mergeInto(LibraryManager.library, { read: MEMFS.stream_ops.read, write: MEMFS.stream_ops.write, allocate: MEMFS.stream_ops.allocate, - mmap: MEMFS.stream_ops.mmap + mmap: MEMFS.stream_ops.mmap, + msync: MEMFS.stream_ops.msync } }, link: { @@ -373,6 +374,19 @@ mergeInto(LibraryManager.library, { } return { ptr: ptr, allocated: allocated }; }, + msync: function(stream, buffer, offset, length, mmapFlags) { + if (!FS.isFile(stream.node.mode)) { + throw new FS.ErrnoError(ERRNO_CODES.ENODEV); + } + if (mmapFlags & {{{ cDefine('MAP_PRIVATE') }}}) { + // MAP_PRIVATE calls need not to be synced back to underlying fs + return 0; + } + + var bytesWritten = MEMFS.stream_ops.write(stream, buffer, 0, length, offset, false); + // should we check if bytesWritten and length are the same? + return 0; + } } } }); diff --git a/tests/fs/test_mmap.c b/tests/fs/test_mmap.c new file mode 100644 index 0000000000000..09ba9e3d41172 --- /dev/null +++ b/tests/fs/test_mmap.c @@ -0,0 +1,123 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main() { + EM_ASM( + FS.mkdir('yolo'); + FS.writeFile('/yolo/in.txt', 'mmap ftw!'); + ); + + // Use mmap to read in.txt + { + const char* path = "/yolo/in.txt"; + int fd = open(path, O_RDONLY); + assert(fd != -1); + + int filesize = 9; + char* map = (char*)mmap(NULL, filesize, PROT_READ, MAP_PRIVATE, fd, 0); + assert(map != MAP_FAILED); + + printf("/yolo/in.txt content="); + for (int i = 0; i < filesize; i++) { + printf("%c", map[i]); + } + printf("\n"); + + int rc = munmap(map, filesize); + assert(rc == 0); + + close(fd); + } + + // Use mmap to write out.txt + { + const char* text = "written mmap"; + const char* path = "/yolo/out.txt"; + + int fd = open(path, O_RDWR | O_CREAT | O_TRUNC, (mode_t)0600); + assert(fd != -1); + + size_t textsize = strlen(text) + 1; // + \0 null character + assert(lseek(fd, textsize - 1, SEEK_SET) != -1); + + // need to write something first to allow us to mmap + assert(write(fd, "", 1) != -1); + + char *map = (char*)mmap(0, textsize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + assert(map != MAP_FAILED); + + for (size_t i = 0; i < textsize; i++) { + map[i] = text[i]; + } + + assert(msync(map, textsize, MS_SYNC) != -1); + + assert(munmap(map, textsize) != -1); + + close(fd); + } + + { + FILE* fd = fopen("/yolo/out.txt", "r"); + if (fd == NULL) { + printf("failed to open /yolo/out.txt\n"); + return 1; + } + char buffer[13]; + fread(buffer, 1, 14, fd); + printf("/yolo/out.txt content=%s\n", buffer); + fclose(fd); + } + + // MAP_PRIVATE + { + const char* text = "written mmap"; + const char* path = "/yolo/private.txt"; + + int fd = open(path, O_RDWR | O_CREAT | O_TRUNC, (mode_t)0600); + assert(fd != -1); + + size_t textsize = strlen(text) + 1; // + \0 null character + assert(lseek(fd, textsize - 1, SEEK_SET) != -1); + + // need to write something first to allow us to mmap + assert(write(fd, "", 1) != -1); + + char *map = (char*)mmap(0, textsize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); + assert(map != MAP_FAILED); + + for (size_t i = 0; i < textsize; i++) { + map[i] = text[i]; + } + + assert(msync(map, textsize, MS_SYNC) != -1); + + assert(munmap(map, textsize) != -1); + + close(fd); + } + + { + FILE* fd = fopen("/yolo/private.txt", "r"); + if (fd == NULL) { + printf("failed to open /yolo/private.txt\n"); + return 1; + } + char buffer[13]; + fread(buffer, 1, 14, fd); + printf("/yolo/private.txt content=%s\n", buffer); + fclose(fd); + } + + return 0; +} diff --git a/tests/fs/test_mmap.out b/tests/fs/test_mmap.out new file mode 100644 index 0000000000000..00d3c3edb8858 --- /dev/null +++ b/tests/fs/test_mmap.out @@ -0,0 +1,3 @@ +/yolo/in.txt content=mmap ftw! +/yolo/out.txt content=written mmap +/yolo/private.txt content= diff --git a/tests/test_core.py b/tests/test_core.py index 6537561044fc2..99b51f8d9d91b 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -4698,6 +4698,15 @@ def test_fs_append(self): src = open(path_from_root('tests', 'fs', 'test_append.c'), 'r').read() self.do_run(src, 'success', force_c=True) + def test_fs_mmap(self): + if self.emcc_args is None: return self.skip('requires emcc') + orig_compiler_opts = Building.COMPILER_TEST_OPTS[:] + for fs in ['MEMFS']: + src = path_from_root('tests', 'fs', 'test_mmap.c') + out = path_from_root('tests', 'fs', 'test_mmap.out') + Building.COMPILER_TEST_OPTS = orig_compiler_opts + ['-D' + fs] + self.do_run_from_file(src, out) + def test_unistd_access(self): self.clear() if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js') From 8edacfd66131cd361b7f046e82da94fd9a9fd4e2 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 25 Mar 2015 19:32:19 -0700 Subject: [PATCH 02/10] expand range of acceptable values for llvm 3.6 on other.test_emterpreter --- tests/test_other.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_other.py b/tests/test_other.py index 1db54b62f29b0..5b00c5e597a08 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -4592,13 +4592,13 @@ def do_log_test(source, expected, func): assert expected == seen or (seen in expected if type(expected) in [list, tuple] else False), ['expect', expected, 'but see', seen] do_log_test(path_from_root('tests', 'primes.cpp'), 88, 'main') - do_log_test(path_from_root('tests', 'fannkuch.cpp'), 237, 'fannkuch_worker') + do_log_test(path_from_root('tests', 'fannkuch.cpp'), range(237, 240), 'fannkuch_worker') # test non-native as well, registerizeHarder can be a little more efficient here old_native = os.environ.get('EMCC_NATIVE_OPTIMIZER') try: os.environ['EMCC_NATIVE_OPTIMIZER'] = '0' - do_log_test(path_from_root('tests', 'fannkuch.cpp'), 237, 'fannkuch_worker') + do_log_test(path_from_root('tests', 'fannkuch.cpp'), range(237, 240), 'fannkuch_worker') finally: if old_native: os.environ['EMCC_NATIVE_OPTIMIZER'] = old_native else: del os.environ['EMCC_NATIVE_OPTIMIZER'] From 84cb53667f8d3dce806915dc0b494e930c176df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Tue, 31 Mar 2015 23:09:40 +0300 Subject: [PATCH 03/10] Fixes to pull request #3269 to pass test_mmap, test_mmap_file and test_freetype. --- src/library.js | 1 + src/library_fs.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/library.js b/src/library.js index ddba8d62a19df..f77bb6ff7ac3e 100644 --- a/src/library.js +++ b/src/library.js @@ -2572,6 +2572,7 @@ LibraryManager.library = { return ptr; }, + munmap__deps: ['msync'], munmap: function(start, num) { if (!_mmap.mappings) _mmap.mappings = {}; // TODO: support unmmap'ing parts of allocations diff --git a/src/library_fs.js b/src/library_fs.js index 771bd1f71fa68..f3cedf63adb38 100644 --- a/src/library_fs.js +++ b/src/library_fs.js @@ -1155,7 +1155,7 @@ mergeInto(LibraryManager.library, { return stream.stream_ops.mmap(stream, buffer, offset, length, position, prot, flags); }, msync: function(stream, buffer, offset, length, mmapFlags) { - if (!stream.stream_ops.msync) { + if (!stream || !stream.stream_ops.msync) { return 0; } return stream.stream_ops.msync(stream, buffer, offset, length, mmapFlags); From d127dc39603a74281c27433a16caa19df046a4cf Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 31 Mar 2015 15:58:19 -0700 Subject: [PATCH 04/10] export Browser.createContext, so that SDL2 can use it --- src/library_browser.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/library_browser.js b/src/library_browser.js index bd6fd55479682..dbf654bf56a06 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -8,7 +8,8 @@ mergeInto(LibraryManager.library, { 'Module["setCanvasSize"] = function Module_setCanvasSize(width, height, noUpdates) { Browser.setCanvasSize(width, height, noUpdates) };\n' + 'Module["pauseMainLoop"] = function Module_pauseMainLoop() { Browser.mainLoop.pause() };\n' + 'Module["resumeMainLoop"] = function Module_resumeMainLoop() { Browser.mainLoop.resume() };\n' + - 'Module["getUserMedia"] = function Module_getUserMedia() { Browser.getUserMedia() }', + 'Module["getUserMedia"] = function Module_getUserMedia() { Browser.getUserMedia() }\n' + + 'Module["createContext"] = function Module_createContext(canvas, useWebGL, setInModule, webGLContextAttributes) { return Browser.createContext(canvas, useWebGL, setInModule, webGLContextAttributes) }', $Browser: { mainLoop: { scheduler: null, From aa2d615688fab2b9422a8bd2109ef6a972cf1db1 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 31 Mar 2015 16:00:44 -0700 Subject: [PATCH 05/10] use SDL2 port version 7 --- tools/ports/sdl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ports/sdl.py b/tools/ports/sdl.py index 4ed5d376f51e8..88d6790db6805 100644 --- a/tools/ports/sdl.py +++ b/tools/ports/sdl.py @@ -1,6 +1,6 @@ import os, shutil, logging -TAG = 'version_6' +TAG = 'version_7' def get_with_configure(ports, settings, shared): # not currently used; no real need for configure on emscripten users' machines! if settings.USE_SDL == 2: From e982d909d756112051acf832dfa9e76053d8d13c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 31 Mar 2015 16:28:04 -0700 Subject: [PATCH 06/10] update other.test_bad_triple --- tests/test_other.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_other.py b/tests/test_other.py index 5b00c5e597a08..6c58a60d432c8 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -2945,8 +2945,8 @@ def test_odin_validation(self): def test_bad_triple(self): Popen([CLANG, path_from_root('tests', 'hello_world.c'), '-c', '-emit-llvm', '-o', 'a.bc'] + get_clang_native_args(), stdout=PIPE, stderr=PIPE).communicate() out, err = Popen([PYTHON, EMCC, 'a.bc'], stdout=PIPE, stderr=PIPE).communicate() - assert 'warning' in err, err - assert 'incorrect target triple' in err, err + assert 'warning' in err or 'WARNING' in err, err + assert 'incorrect target triple' in err or 'different target triples' in err, err def test_valid_abspath(self): # Test whether abspath warning appears From 5fd6331a795e0aec797b9d78e46c9d666b4b40c4 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 31 Mar 2015 16:29:44 -0700 Subject: [PATCH 07/10] update tests/cases/sillyfuncast2_noasm.ll to asm triple --- tests/cases/sillyfuncast2_noasm.ll | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cases/sillyfuncast2_noasm.ll b/tests/cases/sillyfuncast2_noasm.ll index 6c55b990936a8..2ec90888871e0 100644 --- a/tests/cases/sillyfuncast2_noasm.ll +++ b/tests/cases/sillyfuncast2_noasm.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] From f38a340e76229f9980ceb7107a8a09ca3b1d55fc Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 31 Mar 2015 16:44:01 -0700 Subject: [PATCH 08/10] clarify EMCC_LOCAL_PORTS --- tools/system_libs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/system_libs.py b/tools/system_libs.py index e3c9b9372b403..a77eafb4cf967 100644 --- a/tools/system_libs.py +++ b/tools/system_libs.py @@ -794,11 +794,12 @@ class State: def retrieve(): # if EMCC_LOCAL_PORTS is set, we use a local directory as our ports. This is useful # for testing. This env var should be in format - # name=dir|subdir,name=dir|subdir + # name=dir|tag,name=dir|tag # e.g. # sdl2=/home/username/dev/ports/SDL2|SDL2-version_5 # so you could run # EMCC_LOCAL_PORTS="sdl2=/home/alon/Dev/ports/SDL2|SDL2-version_5" ./tests/runner.py browser.test_sdl2_mouse + # note that tag must be the tag in sdl.py, it is where we store to (not where we load from, we just load the local dir) local_ports = os.environ.get('EMCC_LOCAL_PORTS') if local_ports: local_ports = map(lambda pair: pair.split('='), local_ports.split(',')) From 157993c03ccca553b70f44560ff0e59cae86b976 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 31 Mar 2015 17:01:26 -0700 Subject: [PATCH 09/10] update all tests/cases/*.ll to asm triple --- tests/cases/abs.ll | 6 +++--- tests/cases/aliasbitcast2_noasm.ll | 6 +++--- tests/cases/aliasbitcast3_noasm.ll | 6 +++--- tests/cases/aliasbitcastdollar_noasm.ll | 6 +++--- tests/cases/alignedunaligned.ll | 6 +++--- tests/cases/allocavartop.ll | 6 +++--- tests/cases/breakinthemiddle.ll | 1 + tests/cases/breakinthemiddle2.ll | 1 + tests/cases/call_i64_noret.ll | 6 +++--- tests/cases/callalias.ll | 4 ++-- tests/cases/callalias2.ll | 4 ++-- tests/cases/callundef.ll | 4 ++-- tests/cases/cmpxchg_volatile.ll | 6 +++--- tests/cases/emptyasm_aue.ll | 1 + tests/cases/emptystruct.ll | 6 +++--- tests/cases/entry2.ll | 6 +++--- tests/cases/extendedprecision.ll | 6 +++--- tests/cases/floatreturningfuncptr.ll | 6 +++--- tests/cases/frem.ll | 5 +++-- tests/cases/i64toi8star.ll | 6 +++--- tests/cases/indirectbrphi.ll | 6 +++--- tests/cases/inttoptrfloat.ll | 6 +++--- tests/cases/issue_39.ll | 6 +++--- tests/cases/longjmp_tiny.ll | 6 +++--- tests/cases/longjmp_tiny_invoke.ll | 6 +++--- tests/cases/longjmp_tiny_invoke_phi.ll | 6 +++--- tests/cases/longjmp_tiny_keepem.ll | 6 +++--- tests/cases/longjmp_tiny_keepem_cond.ll | 6 +++--- tests/cases/longjmp_tiny_phi.ll | 6 +++--- tests/cases/longjmp_tiny_phi2.ll | 6 +++--- tests/cases/ncurly.ll | 6 +++--- tests/cases/phinonexist.ll | 6 +++--- tests/cases/quoted.ll | 6 +++--- tests/cases/quotedlabel.ll | 6 +++--- tests/cases/returnfp.ll | 6 +++--- tests/cases/selectadd.ll | 5 ++--- tests/cases/selectstruct.ll | 4 ++-- tests/cases/structparam.ll | 6 +++--- tests/cases/subnums.ll | 6 +++--- tests/cases/trace.ll | 7 +++---- tests/cases/trunc.ll | 6 +++--- tests/cases/typestr.ll | 6 +++--- tests/cases/uadd_overflow_64_ta2.ll | 4 ++-- tests/cases/udiv.ll | 6 +++--- tests/cases/unaligneddouble.ll | 4 ++-- tests/cases/unannotated__noasm.ll | 6 +++--- 46 files changed, 125 insertions(+), 123 deletions(-) diff --git a/tests/cases/abs.ll b/tests/cases/abs.ll index 57e06928b52e3..534efe38b6e7e 100644 --- a/tests/cases/abs.ll +++ b/tests/cases/abs.ll @@ -1,6 +1,6 @@ -; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/aliasbitcast2_noasm.ll b/tests/cases/aliasbitcast2_noasm.ll index 5387f2c0dbdf4..515eedc075e3b 100644 --- a/tests/cases/aliasbitcast2_noasm.ll +++ b/tests/cases/aliasbitcast2_noasm.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/emscripten/tmp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" -target triple = "i386-pc-linux-gnu" +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1] diff --git a/tests/cases/aliasbitcast3_noasm.ll b/tests/cases/aliasbitcast3_noasm.ll index 19d3ff14e48c4..393f1525b9651 100644 --- a/tests/cases/aliasbitcast3_noasm.ll +++ b/tests/cases/aliasbitcast3_noasm.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/emscripten/tmp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" -target triple = "i386-pc-linux-gnu" +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1] diff --git a/tests/cases/aliasbitcastdollar_noasm.ll b/tests/cases/aliasbitcastdollar_noasm.ll index 558289b7aaefa..d0c5b41b3717a 100644 --- a/tests/cases/aliasbitcastdollar_noasm.ll +++ b/tests/cases/aliasbitcastdollar_noasm.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/emscripten/tmp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" -target triple = "i386-pc-linux-gnu" +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1] diff --git a/tests/cases/alignedunaligned.ll b/tests/cases/alignedunaligned.ll index f4e0535a33920..9bf7f2a46718d 100644 --- a/tests/cases/alignedunaligned.ll +++ b/tests/cases/alignedunaligned.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/emscripten_temp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" ; Check aligned operations that are of non-aligned sizes (e.g., memcpy of 7 bytes at alignment 4) diff --git a/tests/cases/allocavartop.ll b/tests/cases/allocavartop.ll index e9520a197011f..447c0d3abe87f 100644 --- a/tests/cases/allocavartop.ll +++ b/tests/cases/allocavartop.ll @@ -1,6 +1,6 @@ -; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/breakinthemiddle.ll b/tests/cases/breakinthemiddle.ll index 39aaa9229455f..47905174bd593 100644 --- a/tests/cases/breakinthemiddle.ll +++ b/tests/cases/breakinthemiddle.ll @@ -1,3 +1,4 @@ +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" target triple = "asmjs-unknown-emscripten" diff --git a/tests/cases/breakinthemiddle2.ll b/tests/cases/breakinthemiddle2.ll index db1cb7b6d884a..587b7ce6f85e6 100644 --- a/tests/cases/breakinthemiddle2.ll +++ b/tests/cases/breakinthemiddle2.ll @@ -1,3 +1,4 @@ +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" target triple = "asmjs-unknown-emscripten" diff --git a/tests/cases/call_i64_noret.ll b/tests/cases/call_i64_noret.ll index a8a30fc0f3eff..4e3b136d49c69 100644 --- a/tests/cases/call_i64_noret.ll +++ b/tests/cases/call_i64_noret.ll @@ -1,6 +1,6 @@ -; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/callalias.ll b/tests/cases/callalias.ll index d8a4f83f1f91e..ef2e99ec3ed7b 100644 --- a/tests/cases/callalias.ll +++ b/tests/cases/callalias.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/callalias2.ll b/tests/cases/callalias2.ll index c1df0f600297d..c7489baf24f66 100644 --- a/tests/cases/callalias2.ll +++ b/tests/cases/callalias2.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/callundef.ll b/tests/cases/callundef.ll index a540a08c07f36..91af878e2f29c 100644 --- a/tests/cases/callundef.ll +++ b/tests/cases/callundef.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/cmpxchg_volatile.ll b/tests/cases/cmpxchg_volatile.ll index 538e1585e2d44..c7d8eee43f27e 100644 --- a/tests/cases/cmpxchg_volatile.ll +++ b/tests/cases/cmpxchg_volatile.ll @@ -1,6 +1,6 @@ -; ModuleID = 'ta2.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %"struct.std::__1::__atomic_base.0" = type { i8 } %"struct.std::__1::__atomic_base" = type { %"struct.std::__1::__atomic_base.0" } diff --git a/tests/cases/emptyasm_aue.ll b/tests/cases/emptyasm_aue.ll index 24805591d73f4..c27cf086a639a 100644 --- a/tests/cases/emptyasm_aue.ll +++ b/tests/cases/emptyasm_aue.ll @@ -1,3 +1,4 @@ +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" target triple = "asmjs-unknown-emscripten" diff --git a/tests/cases/emptystruct.ll b/tests/cases/emptystruct.ll index b32ac803ccfdd..c52f18d1ec1a8 100644 --- a/tests/cases/emptystruct.ll +++ b/tests/cases/emptystruct.ll @@ -1,6 +1,6 @@ -; ModuleID = 'emptystruct.c' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %struct.s = type { {}, i32 } diff --git a/tests/cases/entry2.ll b/tests/cases/entry2.ll index 75b266c75910a..5765e664cfb11 100644 --- a/tests/cases/entry2.ll +++ b/tests/cases/entry2.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/tmpKnA2D3/a.out.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [11 x i8] c"getgid=%d\0A\00", align 1 @.str1 = private unnamed_addr constant [6 x i8] c"f=%d\0A\00", align 1 diff --git a/tests/cases/extendedprecision.ll b/tests/cases/extendedprecision.ll index 6f1b2626d64f9..24a005f002385 100644 --- a/tests/cases/extendedprecision.ll +++ b/tests/cases/extendedprecision.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/emscripten/tmp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1] diff --git a/tests/cases/floatreturningfuncptr.ll b/tests/cases/floatreturningfuncptr.ll index e07e97b3ac11b..e134ee78bf5fb 100644 --- a/tests/cases/floatreturningfuncptr.ll +++ b/tests/cases/floatreturningfuncptr.ll @@ -1,6 +1,6 @@ -; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/frem.ll b/tests/cases/frem.ll index 442cd04c68c34..1f8d9b7aad2d2 100644 --- a/tests/cases/frem.ll +++ b/tests/cases/frem.ll @@ -1,5 +1,6 @@ -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" -target triple = "i386-pc-linux-gnu" +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str2 = private constant [6 x i8] c"*%f*\0A\00", align 1 ; [#uses=1] diff --git a/tests/cases/i64toi8star.ll b/tests/cases/i64toi8star.ll index b23074491c7c9..a4d157948a6b5 100644 --- a/tests/cases/i64toi8star.ll +++ b/tests/cases/i64toi8star.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/emscripten/tmp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1] @.str2 = private unnamed_addr constant [9 x i8] c"*%d...*\0A\00", align 1 ; [#uses=1 type=[9 x i8]*] diff --git a/tests/cases/indirectbrphi.ll b/tests/cases/indirectbrphi.ll index 83dfe73c3dabf..b72f32d2b91a9 100644 --- a/tests/cases/indirectbrphi.ll +++ b/tests/cases/indirectbrphi.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/tmpj4LoEu/src.cpp.o.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @_ZZ4mainE5addrs = private unnamed_addr constant [2 x i8*] [i8* blockaddress(@main, %14), i8* blockaddress(@main, %19)], align 4 @.str = private unnamed_addr constant [8 x i8] c"bad %d\0A\00", align 1 diff --git a/tests/cases/inttoptrfloat.ll b/tests/cases/inttoptrfloat.ll index c3349fc4fd587..6b0860ab5de87 100644 --- a/tests/cases/inttoptrfloat.ll +++ b/tests/cases/inttoptrfloat.ll @@ -1,6 +1,6 @@ -; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/issue_39.ll b/tests/cases/issue_39.ll index 96460693550ee..61fbee28d012d 100644 --- a/tests/cases/issue_39.ll +++ b/tests/cases/issue_39.ll @@ -1,6 +1,6 @@ -; ModuleID = '/dev/shm/tmp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-f128:128:128-n8:16:32" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [6 x i8] c"*yes*\00", align 1 ; [#uses=1] diff --git a/tests/cases/longjmp_tiny.ll b/tests/cases/longjmp_tiny.ll index 0045847c127e7..a91157c9ec7ad 100644 --- a/tests/cases/longjmp_tiny.ll +++ b/tests/cases/longjmp_tiny.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/emscripten_temp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @_ZL3buf = internal global [20 x i16] zeroinitializer, align 2 @.str = private unnamed_addr constant [13 x i8] c"hello world\0A\00", align 1 diff --git a/tests/cases/longjmp_tiny_invoke.ll b/tests/cases/longjmp_tiny_invoke.ll index 6f856d492024d..1567b5f3205f7 100644 --- a/tests/cases/longjmp_tiny_invoke.ll +++ b/tests/cases/longjmp_tiny_invoke.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/emscripten_temp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @_ZL3buf = internal global [20 x i16] zeroinitializer, align 2 @.str = private unnamed_addr constant [13 x i8] c"hello world\0A\00", align 1 diff --git a/tests/cases/longjmp_tiny_invoke_phi.ll b/tests/cases/longjmp_tiny_invoke_phi.ll index 0df3f924092a0..caadffbe0900c 100644 --- a/tests/cases/longjmp_tiny_invoke_phi.ll +++ b/tests/cases/longjmp_tiny_invoke_phi.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/emscripten_temp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @_ZL3buf = internal global [20 x i16] zeroinitializer, align 2 @.str = private unnamed_addr constant [13 x i8] c"hello world\0A\00", align 1 diff --git a/tests/cases/longjmp_tiny_keepem.ll b/tests/cases/longjmp_tiny_keepem.ll index bbf9b3e8cb13c..60295ab54c56d 100644 --- a/tests/cases/longjmp_tiny_keepem.ll +++ b/tests/cases/longjmp_tiny_keepem.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/emscripten_temp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [13 x i8] c"hello world\0A\00", align 1 @.str1 = private unnamed_addr constant [6 x i8] c"more\0A\00", align 1 diff --git a/tests/cases/longjmp_tiny_keepem_cond.ll b/tests/cases/longjmp_tiny_keepem_cond.ll index 694ed17f06098..36795ee1be78a 100644 --- a/tests/cases/longjmp_tiny_keepem_cond.ll +++ b/tests/cases/longjmp_tiny_keepem_cond.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/emscripten_temp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [13 x i8] c"hello world\0A\00", align 1 @.str1 = private unnamed_addr constant [6 x i8] c"more\0A\00", align 1 diff --git a/tests/cases/longjmp_tiny_phi.ll b/tests/cases/longjmp_tiny_phi.ll index 21b936dde1dd6..f8012dbc384cd 100644 --- a/tests/cases/longjmp_tiny_phi.ll +++ b/tests/cases/longjmp_tiny_phi.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/emscripten_temp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @_ZL3buf = internal global [20 x i16] zeroinitializer, align 2 @.str = private unnamed_addr constant [13 x i8] c"hello world\0A\00", align 1 diff --git a/tests/cases/longjmp_tiny_phi2.ll b/tests/cases/longjmp_tiny_phi2.ll index 88312fc6da06b..97f7208ef0221 100644 --- a/tests/cases/longjmp_tiny_phi2.ll +++ b/tests/cases/longjmp_tiny_phi2.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/emscripten_temp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @_ZL3buf = internal global [20 x i16] zeroinitializer, align 2 @.str = private unnamed_addr constant [13 x i8] c"hello world\0A\00", align 1 diff --git a/tests/cases/ncurly.ll b/tests/cases/ncurly.ll index 2fb7b0bb03932..ea770022a3da9 100644 --- a/tests/cases/ncurly.ll +++ b/tests/cases/ncurly.ll @@ -1,6 +1,6 @@ -; ModuleID = 'src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %1 = type { %2 } %2 = type <{ i32 }> diff --git a/tests/cases/phinonexist.ll b/tests/cases/phinonexist.ll index 75c1cef66020f..dd0e35f38b2d4 100644 --- a/tests/cases/phinonexist.ll +++ b/tests/cases/phinonexist.ll @@ -1,6 +1,6 @@ -; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/quoted.ll b/tests/cases/quoted.ll index 5bd8dba8faaff..62e9311bbadc2 100644 --- a/tests/cases/quoted.ll +++ b/tests/cases/quoted.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/emscripten/tmp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1] diff --git a/tests/cases/quotedlabel.ll b/tests/cases/quotedlabel.ll index d4b8639c4ff1d..1d997e5b13c43 100644 --- a/tests/cases/quotedlabel.ll +++ b/tests/cases/quotedlabel.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/emscripten/tmp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" -target triple = "i386-pc-linux-gnu" +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1] diff --git a/tests/cases/returnfp.ll b/tests/cases/returnfp.ll index 974459e5686ef..a8177f33593c1 100644 --- a/tests/cases/returnfp.ll +++ b/tests/cases/returnfp.ll @@ -1,6 +1,6 @@ -; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/selectadd.ll b/tests/cases/selectadd.ll index 093032b860b76..1295819e399ea 100644 --- a/tests/cases/selectadd.ll +++ b/tests/cases/selectadd.ll @@ -1,7 +1,6 @@ - ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/selectstruct.ll b/tests/cases/selectstruct.ll index 58b1848e8ad8d..50b9c00e71f84 100644 --- a/tests/cases/selectstruct.ll +++ b/tests/cases/selectstruct.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/structparam.ll b/tests/cases/structparam.ll index 53ee5a9372b09..470bc555cacd3 100644 --- a/tests/cases/structparam.ll +++ b/tests/cases/structparam.ll @@ -1,6 +1,6 @@ -; ModuleID = '/dev/shm/tmp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, %d %d!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] @_dispatchTable = internal global i64 0 diff --git a/tests/cases/subnums.ll b/tests/cases/subnums.ll index dc2af1c7295ea..cd8e1260d2c79 100644 --- a/tests/cases/subnums.ll +++ b/tests/cases/subnums.ll @@ -1,6 +1,6 @@ -; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [18 x i8] c"hello, world! %d\0A\00", align 1 ; [#uses=1 type=[18 x i8]*] diff --git a/tests/cases/trace.ll b/tests/cases/trace.ll index ec68ef92f7c3d..8014d0a9b6717 100644 --- a/tests/cases/trace.ll +++ b/tests/cases/trace.ll @@ -1,12 +1,11 @@ -; ModuleID = 'tests/hello_world.bc' +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" ; A [block] type is used in a function def here. If we investigate types in the very first pass, we will ; make a bad guess as to the size - we assume undef'd types are [int32]. For this code to compile, we must ; only investigate in the first side pass, which is correct since there the type defs are handled. -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" - %struct.TraceKindPair = type { i8*, i32 } @_ZL14traceKindNames = internal constant [4 x %struct.TraceKindPair] [%struct.TraceKindPair { i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0), i32 -1 }, %struct.TraceKindPair { i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0), i32 0 }, %struct.TraceKindPair { i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0), i32 1 }, %struct.TraceKindPair { i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0), i32 3 }], align 4 ; [#uses=3 type=[4 x %struct.TraceKindPair]*] diff --git a/tests/cases/trunc.ll b/tests/cases/trunc.ll index 8eeaf30005ef8..13ddd5246bfe1 100644 --- a/tests/cases/trunc.ll +++ b/tests/cases/trunc.ll @@ -1,6 +1,6 @@ -; ModuleID = '/tmp/emscripten/tmp/src.cpp.o' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" -target triple = "i386-pc-linux-gnu" +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private constant [9 x i8] c"*%d,%d*\0A\00", align 1 ; [#uses=1] diff --git a/tests/cases/typestr.ll b/tests/cases/typestr.ll index 49074637763f7..7a6e0130666c0 100644 --- a/tests/cases/typestr.ll +++ b/tests/cases/typestr.ll @@ -1,6 +1,6 @@ -; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] @.str1227 = private unnamed_addr constant [9 x i8] c" = type \00", align 1 diff --git a/tests/cases/uadd_overflow_64_ta2.ll b/tests/cases/uadd_overflow_64_ta2.ll index 6dfbc1e5838d2..ad479ee95145f 100644 --- a/tests/cases/uadd_overflow_64_ta2.ll +++ b/tests/cases/uadd_overflow_64_ta2.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str2 = private constant [11 x i8] c"*%llx,%d*\0A\00", align 1 ; [#uses=1] diff --git a/tests/cases/udiv.ll b/tests/cases/udiv.ll index a809db5a2f705..e0b35ce71196f 100644 --- a/tests/cases/udiv.ll +++ b/tests/cases/udiv.ll @@ -1,6 +1,6 @@ -; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/unaligneddouble.ll b/tests/cases/unaligneddouble.ll index e40678317d521..f39c56b57cae8 100644 --- a/tests/cases/unaligneddouble.ll +++ b/tests/cases/unaligneddouble.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" -target triple = "i386-pc-linux-gnu" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/unannotated__noasm.ll b/tests/cases/unannotated__noasm.ll index d87b2e54a3f2e..9848746e17cad 100644 --- a/tests/cases/unannotated__noasm.ll +++ b/tests/cases/unannotated__noasm.ll @@ -1,6 +1,6 @@ -; ModuleID = 'test.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" -target triple = "i386-unknown-linux-gnu" +; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [6 x i8] c"test\0A\00" From 3acf4cffcca7d49d1d64e211066b934e4a6f5caa Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 31 Mar 2015 17:10:14 -0700 Subject: [PATCH 10/10] 1.30.2 --- emscripten-version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emscripten-version.txt b/emscripten-version.txt index 816b2c7aa4f7c..5677c30f98274 100644 --- a/emscripten-version.txt +++ b/emscripten-version.txt @@ -1,2 +1,2 @@ -1.30.1 +1.30.2