diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cases/2xi40.ll | 42 | ||||
-rw-r--r-- | tests/cases/2xi40.txt | 1 | ||||
-rw-r--r-- | tests/cases/emptyasm_le32.ll | 16 | ||||
-rw-r--r-- | tests/test_browser.py | 2 | ||||
-rw-r--r-- | tests/test_core.py | 3 |
5 files changed, 63 insertions, 1 deletions
diff --git a/tests/cases/2xi40.ll b/tests/cases/2xi40.ll new file mode 100644 index 00000000..592f1ba4 --- /dev/null +++ b/tests/cases/2xi40.ll @@ -0,0 +1,42 @@ +; 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:32" +target triple = "le32-unknown-nacl" + +%struct.pair = type { [5 x i8], [5 x i8] } + +@.str = private unnamed_addr constant [6 x i8] c"|%d|\0A\00", align 1 +@.str1 = private unnamed_addr constant [7 x i8] c"%s,%s\0A\00", align 1 + +define i32 @main() { + %1 = alloca i32, align 4 + %pp = alloca [2 x i40], align 8 + %p = bitcast [2 x i40]* %pp to %struct.pair* + store i32 0, i32* %1 + %2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), i32 10) + %3 = bitcast %struct.pair* %p to i8* + call void @llvm.memset.p0i8.i32(i8* %3, i8 120, i32 10, i32 1, i1 false) + %4 = getelementptr inbounds [2 x i40]* %pp, i32 0, i32 0 + %b4 = bitcast i40* %4 to [5 x i8]* + %5 = getelementptr inbounds [5 x i8]* %b4, i32 0, i32 2 + store i8 97, i8* %5, align 1 + %6 = getelementptr inbounds %struct.pair* %p, i32 0, i32 0 + %7 = getelementptr inbounds [5 x i8]* %6, i32 0, i32 4 + store i8 0, i8* %7, align 1 + %8 = getelementptr inbounds %struct.pair* %p, i32 0, i32 1 + %9 = getelementptr inbounds [5 x i8]* %8, i32 0, i32 3 + store i8 98, i8* %9, align 1 + %10 = getelementptr inbounds [2 x i40]* %pp, i32 0, i32 1 + %b10 = bitcast i40* %10 to [5 x i8]* + %11 = getelementptr inbounds [5 x i8]* %b10, i32 0, i32 4 + store i8 0, i8* %11, align 1 + %12 = getelementptr inbounds %struct.pair* %p, i32 0, i32 0 + %13 = getelementptr inbounds [5 x i8]* %12, i32 0, i32 0 + %14 = getelementptr inbounds %struct.pair* %p, i32 0, i32 1 + %15 = getelementptr inbounds [5 x i8]* %14, i32 0, i32 0 + %16 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([7 x i8]* @.str1, i32 0, i32 0), i8* %13, i8* %15) + ret i32 0 +} + +declare i32 @printf(i8*, ...) + +declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind diff --git a/tests/cases/2xi40.txt b/tests/cases/2xi40.txt new file mode 100644 index 00000000..59a1104e --- /dev/null +++ b/tests/cases/2xi40.txt @@ -0,0 +1 @@ +xxax,xxxb diff --git a/tests/cases/emptyasm_le32.ll b/tests/cases/emptyasm_le32.ll new file mode 100644 index 00000000..e123d3d5 --- /dev/null +++ b/tests/cases/emptyasm_le32.ll @@ -0,0 +1,16 @@ +; ModuleID = 'tests/hello_world.bc' + +@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] + +; [#uses=0] +define i32 @main() { +entry: + %retval = alloca i32, align 4 ; [#uses=1 type=i32*] + store i32 0, i32* %retval + call void asm sideeffect "", "~{memory}"() nounwind, !srcloc !0 + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) ; [#uses=0 type=i32] + ret i32 1 +} + +; [#uses=1] +declare i32 @printf(i8*, ...) diff --git a/tests/test_browser.py b/tests/test_browser.py index 28a6f139..0fb45124 100644 --- a/tests/test_browser.py +++ b/tests/test_browser.py @@ -992,7 +992,7 @@ keydown(100);keyup(100); // trigger the end def test_sdl_canvas_size(self): self.btest('sdl_canvas_size.c', reference='screenshot-gray-purple.png', reference_slack=1, - args=['-O2', '--minify', '0', '--shell-file', path_from_root('tests', 'sdl_canvas_size.html'), '--preload-file', os.path.join(self.get_dir(), 'screenshot.png') + '@/', '-s', 'LEGACY_GL_EMULATION=1'], + args=['-O2', '--minify', '0', '--shell-file', path_from_root('tests', 'sdl_canvas_size.html'), '--preload-file', path_from_root('tests', 'screenshot.png') + '@/', '-s', 'LEGACY_GL_EMULATION=1'], message='You should see an image with gray at the top.') def test_sdl_gl_read(self): diff --git a/tests/test_core.py b/tests/test_core.py index 69fb31f3..dd5b1e39 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -9044,6 +9044,9 @@ def process(filename): if '_noasm' in shortname and Settings.ASM_JS: print self.skip('case "%s" not relevant for asm.js' % shortname) continue + if '_le32' in shortname and not self.is_le32(): + print self.skip('case "%s" not relevant for non-le32 target' % shortname) + continue self.emcc_args = emcc_args if os.path.exists(shortname + '.emcc'): if not self.emcc_args: continue |