Skip to content

Commit

Permalink
tests: emscripten doesn't support common symbols, so skip COMMON tests
Browse files Browse the repository at this point in the history
clang (as of v12.0.0) throws an error on the __attribute__((common)) in the
produced .c so these tests prevented building fbc-tests. Emscripten doesn't
support it with -sWASM=0 either, because that still first compiles to wasm .o
files. There's apparently no plan to support common symbols in wasm.

A couple of the tests in namespace/redim-3.bas are kludged to compile but fail.
  • Loading branch information
rversteegen committed Jun 26, 2023
1 parent 8131a1e commit 966e796
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/dim/common-shared-1.bas
@@ -1,5 +1,8 @@
#include "fbcunit.bi"

'' Emscripten (and wasm) doesn't support common symbols
#ifndef __FB_JS__

#include "common-shared.bi"

'' COMMON SHARED in the global namespace test
Expand Down Expand Up @@ -73,3 +76,5 @@ SUITE( fbc_tests.dim_.common_shared_1 )
shadowingACommon.test_proc
END_TEST
END_SUITE

#endif
5 changes: 5 additions & 0 deletions tests/dim/common-shared-2.bas
@@ -1,5 +1,8 @@
#include "fbcunit.bi"

'' Emscripten (and wasm) doesn't support common symbols
#ifndef __FB_JS__

#include "common-shared.bi"

'' COMMON SHARED in the global namespace test
Expand All @@ -16,3 +19,5 @@ sub commonShared2Checks( )
CU_ASSERT( lbound( arrayi5 ) = 5 ) : CU_ASSERT( ubound( arrayi5 ) = 5 )
CU_ASSERT( lbound( arrayi6 ) = 6 ) : CU_ASSERT( ubound( arrayi6 ) = 6 )
end sub

#endif
5 changes: 5 additions & 0 deletions tests/dim/redim.bas
Expand Up @@ -78,6 +78,9 @@ SUITE( fbc_tests.dim_.redim_ )
END_TEST
END_TEST_GROUP

'' Emscripten (and wasm) doesn't support common symbols
#ifndef __FB_JS__

'' Regression test for #3474348
TEST_GROUP( commonRedimRedim )
common array() as integer
Expand Down Expand Up @@ -115,6 +118,8 @@ SUITE( fbc_tests.dim_.redim_ )
END_TEST
END_TEST_GROUP

#endif

'' Regression test for #3510684: An array using a different mangling, which
'' affects the array descriptor too -- should still work just the same.
extern "C"
Expand Down
6 changes: 6 additions & 0 deletions tests/namespace/redim-3.bas
@@ -1,5 +1,11 @@
#include "fbcunit.bi"

'' Emscripten (and wasm) doesn't support common symbols
#ifdef __FB_JS__
#undef common
#define common dim '' Fixes the compile but fails tests
#endif

common shared array1() as integer
common shared array2() as integer
dim shared array3() as integer
Expand Down

0 comments on commit 966e796

Please sign in to comment.