aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/analyzer.js2
-rw-r--r--src/library.js4
-rw-r--r--src/library_gl.js2
-rw-r--r--src/utility.js6
-rw-r--r--system/include/sys/sendfile.h16
-rw-r--r--tests/cases/structphiparam.ll36
-rw-r--r--tests/cases/structphiparam.txt1
-rw-r--r--tests/cube_explosion.c16
-rw-r--r--tests/cube_explosion.pngbin0 -> 164108 bytes
-rw-r--r--tests/cubegeom.c18
-rw-r--r--tests/cubegeom.pngbin0 -> 216158 bytes
-rw-r--r--tests/cubegeom_color.pngbin0 -> 83030 bytes
-rw-r--r--tests/cubegeom_color2.c16
-rw-r--r--tests/cubegeom_color2.pngbin0 -> 76128 bytes
-rw-r--r--tests/cubegeom_fog.c16
-rw-r--r--tests/cubegeom_fog.pngbin0 -> 46290 bytes
-rw-r--r--tests/cubegeom_glew.c17
-rw-r--r--tests/cubegeom_mt.c16
-rw-r--r--tests/cubegeom_mt.pngbin0 -> 262750 bytes
-rw-r--r--tests/cubegeom_normal.c16
-rw-r--r--tests/cubegeom_normal.pngbin0 -> 28315 bytes
-rw-r--r--tests/cubegeom_normal_dap.c17
-rw-r--r--tests/cubegeom_normal_dap_far.c16
-rw-r--r--tests/cubegeom_normal_dap_far_glda.c16
-rw-r--r--tests/cubegeom_normal_dap_far_glda.pngbin0 -> 13868 bytes
-rw-r--r--tests/cubegeom_normal_dap_far_glda_quad.c16
-rw-r--r--tests/cubegeom_normal_dap_far_glda_quad.pngbin0 -> 18005 bytes
-rw-r--r--tests/cubegeom_normal_dap_far_range.c16
-rw-r--r--tests/cubegeom_normal_dap_far_range.pngbin0 -> 28315 bytes
-rw-r--r--tests/cubegeom_pre.c17
-rw-r--r--tests/cubegeom_pre.pngbin0 -> 173408 bytes
-rw-r--r--tests/cubegeom_pre2.c16
-rw-r--r--tests/cubegeom_pre2.pngbin0 -> 173408 bytes
-rw-r--r--tests/cubegeom_pre2_vao.c16
-rw-r--r--tests/cubegeom_pre2_vao2.c16
-rw-r--r--tests/cubegeom_pre2_vao2.pngbin0 -> 2956 bytes
-rw-r--r--tests/cubegeom_pre3.c16
-rw-r--r--tests/cubegeom_pre_vao.c16
-rw-r--r--tests/cubegeom_pre_vao.pngbin0 -> 173408 bytes
-rw-r--r--tests/cubegeom_texturematrix.c16
-rw-r--r--tests/cubegeom_texturematrix.pngbin0 -> 47014 bytes
-rw-r--r--tests/dirent/test_readdir.c3
-rw-r--r--tests/fcntl-open/src.c3
-rw-r--r--tests/glbook/CH02_HelloTriangle.pngbin1009 -> 866 bytes
-rw-r--r--tests/glbook/CH08_SimpleVertexShader.pngbin1600 -> 1200 bytes
-rw-r--r--tests/glbook/CH09_SimpleTexture2D.pngbin1943 -> 713 bytes
-rw-r--r--tests/glbook/CH09_TextureCubemap.pngbin3209 -> 2325 bytes
-rw-r--r--tests/glbook/CH09_TextureWrap.pngbin1812 -> 894 bytes
-rw-r--r--tests/glbook/CH10_MultiTexture.pngbin59495 -> 46810 bytes
-rw-r--r--tests/glbook/CH13_ParticleSystem.pngbin4921 -> 4285 bytes
-rw-r--r--tests/htmltest.pngbin743 -> 730 bytes
-rwxr-xr-xtests/runner.py77
-rw-r--r--tests/sdl_gfx_primitives.pngbin2357 -> 2261 bytes
-rw-r--r--tests/sdl_maprgba.pngbin1875 -> 1862 bytes
-rw-r--r--tests/sdl_rotozoom.pngbin431921 -> 431168 bytes
-rw-r--r--tests/stat/test_chmod.c3
-rw-r--r--tests/stat/test_mknod.c3
-rw-r--r--tests/stat/test_stat.c3
-rw-r--r--tests/stdio/test_fgetc_ungetc.c7
-rw-r--r--tests/unistd/unlink.c3
-rw-r--r--tests/utime/test_utime.c3
-rw-r--r--tools/file_packager.py21
-rw-r--r--tools/js-optimizer.js27
-rw-r--r--tools/shared.py2
64 files changed, 162 insertions, 369 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index b1f0b585..1a752305 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -338,7 +338,7 @@ function analyzer(data, sidePass) {
if (subItem != item && (!(subItem.intertype in UNUNFOLDABLE) ||
(subItem.intertype == 'value' && isNumber(subItem.ident) && isIllegalType(subItem.type)))) {
if (item.intertype == 'phi') {
- assert(subItem.intertype == 'value' || subItem.intertype == 'structvalue', 'We can only unfold illegal constants in phis');
+ assert(subItem.intertype == 'value' || subItem.intertype == 'structvalue' || subItem.intertype in PARSABLE_LLVM_FUNCTIONS, 'We can only unfold some expressions in phis');
// we must handle this in the phi itself, if we unfold normally it will not be pushed back with the phi
} else {
var tempIdent = '$$etemp$' + (tempId++);
diff --git a/src/library.js b/src/library.js
index 7978e9cb..85d1d13f 100644
--- a/src/library.js
+++ b/src/library.js
@@ -7844,7 +7844,7 @@ LibraryManager.library = {
inet_pton__deps: ['__setErrNo', '$ERRNO_CODES', 'inet_addr'],
inet_pton: function(af, src, dst) {
// int af, const char *src, void *dst
- if ((af ^ {{{ cDefine("AF_INET") }}}) !== 0) { ___setErrNo(ERRNO_CODES.EAFNOSUPPORT); return -1; }
+ if ((af ^ {{{ cDefine('AF_INET') }}}) !== 0) { ___setErrNo(ERRNO_CODES.EAFNOSUPPORT); return -1; }
var ret = _inet_addr(src);
if (ret == -1 || isNaN(ret)) return 0;
setValue(dst, ret, 'i32');
@@ -7932,7 +7932,7 @@ LibraryManager.library = {
var aliasesBuf = _malloc(4);
setValue(aliasesBuf, 0, 'i8*');
setValue(ret+___hostent_struct_layout.h_aliases, aliasesBuf, 'i8**');
- setValue(ret+___hostent_struct_layout.h_addrtype, {{{ cDefine("AF_INET") }}}, 'i32');
+ setValue(ret+___hostent_struct_layout.h_addrtype, {{{ cDefine('AF_INET') }}}, 'i32');
setValue(ret+___hostent_struct_layout.h_length, 4, 'i32');
var addrListBuf = _malloc(12);
setValue(addrListBuf, addrListBuf+8, 'i32*');
diff --git a/src/library_gl.js b/src/library_gl.js
index 737db8cf..8c724245 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -1323,7 +1323,7 @@ var LibraryGL = {
GLEmulation.fogColor = new Float32Array(4);
// Add some emulation workarounds
- Module.printErr('WARNING: using emscripten GL emulation. This is a collection of limited workarounds, do not expect it to work');
+ Module.printErr('WARNING: using emscripten GL emulation. This is a collection of limited workarounds, do not expect it to work. (If you do not want this, build with -s DISABLE_GL_EMULATION=1)');
#if GL_UNSAFE_OPTS == 0
Module.printErr('WARNING: using emscripten GL emulation unsafe opts. If weirdness happens, try -s GL_UNSAFE_OPTS=0');
#endif
diff --git a/src/utility.js b/src/utility.js
index 9cc8d3a3..7d122cef 100644
--- a/src/utility.js
+++ b/src/utility.js
@@ -312,6 +312,12 @@ function setUnion(x, y) {
return ret;
}
+function setSize(x) {
+ var ret = 0;
+ for (var xx in x) ret++;
+ return ret;
+}
+
function invertArray(x) {
var ret = {};
for (var i = 0; i < x.length; i++) {
diff --git a/system/include/sys/sendfile.h b/system/include/sys/sendfile.h
new file mode 100644
index 00000000..1f58f0dd
--- /dev/null
+++ b/system/include/sys/sendfile.h
@@ -0,0 +1,16 @@
+#ifndef _SYS_SENDFILE_H
+#define _SYS_SENDFILE_H
+
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/tests/cases/structphiparam.ll b/tests/cases/structphiparam.ll
new file mode 100644
index 00000000..117bdf77
--- /dev/null
+++ b/tests/cases/structphiparam.ll
@@ -0,0 +1,36 @@
+; 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"
+
+@.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
+
+define i32 @doit(i32 %x, { i32, i32 } %y) {
+ %y0 = extractvalue { i32, i32 } %y, 0
+ %y1 = extractvalue { i32, i32 } %y, 1
+ %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0), i32 %y0, i32 %y1) ; [#uses=0 type=i32] [debug line = 5:13]
+ ret i32 0
+}
+
+define i32 @main(i32 %argc) {
+entry:
+ %retval = alloca i32, align 4 ; [#uses=1 type=i32*]
+ %myi64 = alloca i64, align 4
+ %comp = alloca { i32, i32 }, align 4 ; [#uses=1]
+ store i32 0, i32* %retval
+ %should = icmp ne i32 %argc, 1337
+ br i1 %should, label %cond.end, label %cond.null
+
+cond.null:
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %cond.true
+ %cond = phi { i32, i32 } [ { i32 zext (i8 111 to i32), i32 6 }, %entry ], [ zeroinitializer, %cond.null ] ; [#uses=1]
+ store { i32, i32 } %cond, { i32, i32 }* %comp
+ %call = call i32 (i32, { i32, i32 })* @doit(i32 1, { i32, i32 } %cond) ;
+ ret i32 0 ; [debug line = 6:13]
+}
+
+; [#uses=1]
+declare i32 @printf(i8*, ...)
+
diff --git a/tests/cases/structphiparam.txt b/tests/cases/structphiparam.txt
new file mode 100644
index 00000000..f5af49f1
--- /dev/null
+++ b/tests/cases/structphiparam.txt
@@ -0,0 +1 @@
+hello, 111 6!
diff --git a/tests/cube_explosion.c b/tests/cube_explosion.c
index 3f55b3c6..0c6eb674 100644
--- a/tests/cube_explosion.c
+++ b/tests/cube_explosion.c
@@ -29,20 +29,6 @@ REDISTRIBUTION OF THIS SOFTWARE.
#include <string.h>
#include <assert.h>
-void verify() {
- int width = 640, height = 480;
- unsigned char *data = (unsigned char*)malloc(width*height*4);
- glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
- int sum = 0;
- for (int x = 0; x < width*height*4; x++) {
- if (x % 4 != 3) sum += x * data[x];
- }
-#if EMSCRIPTEN
- int result = sum;
- REPORT_RESULT();
-#endif
-}
-
int main(int argc, char *argv[])
{
SDL_Surface *screen;
@@ -230,8 +216,6 @@ int main(int argc, char *argv[])
glDeleteTextures(1, &texture);
assert(!glIsTexture(texture)); // but not anymore
- verify();
-
#if !EMSCRIPTEN
SDL_Delay(1500);
#endif
diff --git a/tests/cube_explosion.png b/tests/cube_explosion.png
new file mode 100644
index 00000000..58a16f2b
--- /dev/null
+++ b/tests/cube_explosion.png
Binary files differ
diff --git a/tests/cubegeom.c b/tests/cubegeom.c
index 787b8373..949a1f9a 100644
--- a/tests/cubegeom.c
+++ b/tests/cubegeom.c
@@ -29,20 +29,6 @@ REDISTRIBUTION OF THIS SOFTWARE.
#include <string.h>
#include <assert.h>
-void verify() {
- int width = 640, height = 480;
- unsigned char *data = (unsigned char*)malloc(width*height*4);
- glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
- int sum = 0;
- for (int x = 0; x < width*height*4; x++) {
- if (x % 4 != 3) sum += x * data[x];
- }
-#if EMSCRIPTEN
- int result = sum;
- REPORT_RESULT();
-#endif
-}
-
int main(int argc, char *argv[])
{
int temp; // testing
@@ -308,9 +294,7 @@ int main(int argc, char *argv[])
// END
SDL_GL_SwapBuffers();
-
- verify();
-
+
#if !EMSCRIPTEN
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom.png b/tests/cubegeom.png
new file mode 100644
index 00000000..1c6a7fd5
--- /dev/null
+++ b/tests/cubegeom.png
Binary files differ
diff --git a/tests/cubegeom_color.png b/tests/cubegeom_color.png
new file mode 100644
index 00000000..a1d15438
--- /dev/null
+++ b/tests/cubegeom_color.png
Binary files differ
diff --git a/tests/cubegeom_color2.c b/tests/cubegeom_color2.c
index 5294329d..76d71d00 100644
--- a/tests/cubegeom_color2.c
+++ b/tests/cubegeom_color2.c
@@ -29,20 +29,6 @@ REDISTRIBUTION OF THIS SOFTWARE.
#include <string.h>
#include <assert.h>
-void verify() {
- int width = 640, height = 480;
- unsigned char *data = (unsigned char*)malloc(width*height*4);
- glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
- int sum = 0;
- for (int x = 0; x < width*height*4; x++) {
- if (x % 4 != 3) sum += x * data[x];
- }
-#if EMSCRIPTEN
- int result = sum;
- REPORT_RESULT();
-#endif
-}
-
int main(int argc, char *argv[])
{
SDL_Surface *screen;
@@ -287,8 +273,6 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
- verify();
-
#if !EMSCRIPTEN
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_color2.png b/tests/cubegeom_color2.png
new file mode 100644
index 00000000..ee78eb63
--- /dev/null
+++ b/tests/cubegeom_color2.png
Binary files differ
diff --git a/tests/cubegeom_fog.c b/tests/cubegeom_fog.c
index 9c04a55d..cae6ca2d 100644
--- a/tests/cubegeom_fog.c
+++ b/tests/cubegeom_fog.c
@@ -29,20 +29,6 @@ REDISTRIBUTION OF THIS SOFTWARE.
#include <string.h>
#include <assert.h>
-void verify() {
- int width = 640, height = 480;
- unsigned char *data = (unsigned char*)malloc(width*height*4);
- glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
- int sum = 0;
- for (int x = 0; x < width*height*4; x++) {
- if (x % 4 != 3) sum += x * data[x];
- }
-#if EMSCRIPTEN
- int result = sum;
- REPORT_RESULT();
-#endif
-}
-
int main(int argc, char *argv[])
{
SDL_Surface *screen;
@@ -295,8 +281,6 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
- verify();
-
#if !EMSCRIPTEN
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_fog.png b/tests/cubegeom_fog.png
new file mode 100644
index 00000000..c88e5a14
--- /dev/null
+++ b/tests/cubegeom_fog.png
Binary files differ
diff --git a/tests/cubegeom_glew.c b/tests/cubegeom_glew.c
index 22ef5d74..a3d86a40 100644
--- a/tests/cubegeom_glew.c
+++ b/tests/cubegeom_glew.c
@@ -19,20 +19,6 @@ REDISTRIBUTION OF THIS SOFTWARE.
#include <string.h>
#include <assert.h>
-void verify() {
- int width = 640, height = 480;
- unsigned char *data = (unsigned char*)malloc(width*height*4);
- glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
- int sum = 0;
- for (int x = 0; x < width*height*4; x++) {
- if (x % 4 != 3) sum += x * data[x];
- }
-#if EMSCRIPTEN
- int result = sum;
- REPORT_RESULT();
-#endif
-}
-
int main(int argc, char *argv[])
{
int temp; // testing
@@ -297,8 +283,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
- verify();
-
+
#if !EMSCRIPTEN
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_mt.c b/tests/cubegeom_mt.c
index 464de7cc..b4ad28a7 100644
--- a/tests/cubegeom_mt.c
+++ b/tests/cubegeom_mt.c
@@ -29,20 +29,6 @@ REDISTRIBUTION OF THIS SOFTWARE.
#include <string.h>
#include <assert.h>
-void verify() {
- int width = 640, height = 480;
- unsigned char *data = (unsigned char*)malloc(width*height*4);
- glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
- int sum = 0;
- for (int x = 0; x < width*height*4; x++) {
- if (x % 4 != 3) sum += x * data[x];
- }
-#if EMSCRIPTEN
- int result = sum;
- REPORT_RESULT();
-#endif
-}
-
int main(int argc, char *argv[])
{
SDL_Surface *screen;
@@ -288,8 +274,6 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
- verify();
-
#if !EMSCRIPTEN
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_mt.png b/tests/cubegeom_mt.png
new file mode 100644
index 00000000..47649cdc
--- /dev/null
+++ b/tests/cubegeom_mt.png
Binary files differ
diff --git a/tests/cubegeom_normal.c b/tests/cubegeom_normal.c
index d128fef2..02655edf 100644
--- a/tests/cubegeom_normal.c
+++ b/tests/cubegeom_normal.c
@@ -29,20 +29,6 @@ REDISTRIBUTION OF THIS SOFTWARE.
#include <string.h>
#include <assert.h>
-void verify() {
- int width = 640, height = 480;
- unsigned char *data = (unsigned char*)malloc(width*height*4);
- glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
- int sum = 0;
- for (int x = 0; x < width*height*4; x++) {
- if (x % 4 != 3) sum += x * data[x];
- }
-#if EMSCRIPTEN
- int result = sum;
- REPORT_RESULT();
-#endif
-}
-
int main(int argc, char *argv[])
{
SDL_Surface *screen;
@@ -283,8 +269,6 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
- verify();
-
#if !EMSCRIPTEN
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_normal.png b/tests/cubegeom_normal.png
new file mode 100644
index 00000000..7e3b35d1
--- /dev/null
+++ b/tests/cubegeom_normal.png
Binary files differ
diff --git a/tests/cubegeom_normal_dap.c b/tests/cubegeom_normal_dap.c
index f811c586..752911a8 100644
--- a/tests/cubegeom_normal_dap.c
+++ b/tests/cubegeom_normal_dap.c
@@ -29,20 +29,6 @@ REDISTRIBUTION OF THIS SOFTWARE.
#include <string.h>
#include <assert.h>
-void verify() {
- int width = 640, height = 480;
- unsigned char *data = (unsigned char*)malloc(width*height*4);
- glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
- int sum = 0;
- for (int x = 0; x < width*height*4; x++) {
- if (x % 4 != 3) sum += x * data[x];
- }
-#if EMSCRIPTEN
- int result = sum;
- REPORT_RESULT();
-#endif
-}
-
int main(int argc, char *argv[])
{
SDL_Surface *screen;
@@ -279,8 +265,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
- verify();
-
+
#if !EMSCRIPTEN
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_normal_dap_far.c b/tests/cubegeom_normal_dap_far.c
index f954b3c7..35a068d9 100644
--- a/tests/cubegeom_normal_dap_far.c
+++ b/tests/cubegeom_normal_dap_far.c
@@ -29,20 +29,6 @@ REDISTRIBUTION OF THIS SOFTWARE.
#include <string.h>
#include <assert.h>
-void verify() {
- int width = 640, height = 480;
- unsigned char *data = (unsigned char*)malloc(width*height*4);
- glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
- int sum = 0;
- for (int x = 0; x < width*height*4; x++) {
- if (x % 4 != 3) sum += x * data[x];
- }
-#if EMSCRIPTEN
- int result = sum;
- REPORT_RESULT();
-#endif
-}
-
int main(int argc, char *argv[])
{
SDL_Surface *screen;
@@ -277,8 +263,6 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
- verify();
-
#if !EMSCRIPTEN
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_normal_dap_far_glda.c b/tests/cubegeom_normal_dap_far_glda.c
index a4b4975b..849245b8 100644
--- a/tests/cubegeom_normal_dap_far_glda.c
+++ b/tests/cubegeom_normal_dap_far_glda.c
@@ -29,20 +29,6 @@ REDISTRIBUTION OF THIS SOFTWARE.
#include <string.h>
#include <assert.h>
-void verify() {
- int width = 640, height = 480;
- unsigned char *data = (unsigned char*)malloc(width*height*4);
- glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
- int sum = 0;
- for (int x = 0; x < width*height*4; x++) {
- if (x % 4 != 3) sum += x * data[x];
- }
-#if EMSCRIPTEN
- int result = sum;
- REPORT_RESULT();
-#endif
-}
-
int main(int argc, char *argv[])
{
SDL_Surface *screen;
@@ -268,8 +254,6 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
- verify();
-
#if !EMSCRIPTEN
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_normal_dap_far_glda.png b/tests/cubegeom_normal_dap_far_glda.png
new file mode 100644
index 00000000..815efeb9
--- /dev/null
+++ b/tests/cubegeom_normal_dap_far_glda.png
Binary files differ
diff --git a/tests/cubegeom_normal_dap_far_glda_quad.c b/tests/cubegeom_normal_dap_far_glda_quad.c
index aa6383b8..93c157a4 100644
--- a/tests/cubegeom_normal_dap_far_glda_quad.c
+++ b/tests/cubegeom_normal_dap_far_glda_quad.c
@@ -29,20 +29,6 @@ REDISTRIBUTION OF THIS SOFTWARE.
#include <string.h>
#include <assert.h>
-void verify() {
- int width = 640, height = 480;
- unsigned char *data = (unsigned char*)malloc(width*height*4);
- glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
- int sum = 0;
- for (int x = 0; x < width*height*4; x++) {
- if (x % 4 != 3) sum += x * data[x];
- }
-#if EMSCRIPTEN
- int result = sum;
- REPORT_RESULT();
-#endif
-}
-
int main(int argc, char *argv[])
{
SDL_Surface *screen;
@@ -268,8 +254,6 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
- verify();
-
#if !EMSCRIPTEN
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_normal_dap_far_glda_quad.png b/tests/cubegeom_normal_dap_far_glda_quad.png
new file mode 100644
index 00000000..8683b0ed
--- /dev/null
+++ b/tests/cubegeom_normal_dap_far_glda_quad.png
Binary files differ
diff --git a/tests/cubegeom_normal_dap_far_range.c b/tests/cubegeom_normal_dap_far_range.c
index eb54c22a..17691ce9 100644
--- a/tests/cubegeom_normal_dap_far_range.c
+++ b/tests/cubegeom_normal_dap_far_range.c
@@ -29,20 +29,6 @@ REDISTRIBUTION OF THIS SOFTWARE.
#include <string.h>
#include <assert.h>
-void verify() {
- int width = 640, height = 480;
- unsigned char *data = (unsigned char*)malloc(width*height*4);
- glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
- int sum = 0;
- for (int x = 0; x < width*height*4; x++) {
- if (x % 4 != 3) sum += x * data[x];
- }
-#if EMSCRIPTEN
- int result = sum;
- REPORT_RESULT();
-#endif
-}
-
int main(int argc, char *argv[])
{
SDL_Surface *screen;
@@ -277,8 +263,6 @@ int main(int argc, char *argv[])
SDL_GL_Sw