@@ -1,3 +1,5 @@
+/* { dg-skip-if "wasi-libc doesn't work well with analyzer" { wasm*-*-* } } */
+
#include <errno.h>
#include "analyzer-decls.h"
@@ -1,5 +1,6 @@
/* { dg-skip-if "" { powerpc*-*-aix* } } */
/* { dg-skip-if "" { "avr-*-*" } } */
+/* { dg-skip-if "" { "wasm*-*-*" } } */
#include <errno.h>
#include "../../gcc.dg/analyzer/analyzer-decls.h"
@@ -7,6 +7,7 @@
/* { dg-xfail-if "Inconsistent constraint on asm" { csky-*-* } { "-O0" } { "" } } */
/* { dg-xfail-if "Inconsistent constraint on asm" { bpf-*-* } { "-O0" } { "" } } */
/* { dg-xfail-if "" { h8300-*-* } } */
+/* { dg-skip-if "" { wasm*-*-* } } */
/* { dg-require-stack-size "99*4+16" } */
/* { dg-additional-options "-std=gnu89" } */
@@ -1,6 +1,7 @@
/* PR tree-optimization/55921 */
/* { dg-skip-if "Not enough registers" { "pdp11-*-*" } } */
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
+/* { dg-skip-if "" { wasm*-*-* } } */
typedef union
{
@@ -1,4 +1,4 @@
-/* { dg-options "-fdata-sections" { target { { ! { { hppa*-*-hpux* } && { ! lp64 } } } && { ! "nvptx-*-* pdp11-*-*" } } } } */
+/* { dg-options "-fdata-sections" { target { { ! { { hppa*-*-hpux* } && { ! lp64 } } } && { ! "nvptx-*-* pdp11-*-* wasm*-*-*" } } } } */
typedef unsigned char unit;
typedef unit *unitptr;
@@ -3,7 +3,7 @@
succeeded at all. We use volatile to make sure the long long is
actually truncated to int, in case a single register is wide enough
for a long long. */
-/* { dg-skip-if "asm requires register allocation" { nvptx-*-* } } */
+/* { dg-skip-if "asm requires register allocation" { nvptx-*-* wasm*-*-* } } */
#include <limits.h>
void abort (void);
@@ -1,6 +1,6 @@
load_lib target-supports.exp
-if [istarget "nvptx-*-*"] {
+if { [istarget "nvptx-*-*"] || [istarget "wasm*-*-*"] } {
# This test uses memcpy for block move in the same file as it
# defines it. The two decls are not the same, by design, and we
# end up emitting a definition of memcpy, along with a .extern
@@ -5,6 +5,7 @@
/* { dg-add-options ieee } */
/* { dg-require-effective-target bfloat16_runtime } */
/* { dg-additional-options "-fsignaling-nans" } */
+/* { dg-skip-if "WASM does not have signaling NaNs" { wasm*-*-* } } */
/* Workaround for PR57484 on ia32: */
/* { dg-additional-options "-msse2 -mfpmath=sse" { target { ia32 && sse2_runtime } } } */
@@ -1,6 +1,7 @@
/* { dg-do run } */
/* { dg-add-options ieee } */
/* { dg-additional-options "-fsignaling-nans" } */
+/* { dg-skip-if "WASM does not have signaling NaNs" { wasm*-*-* } } */
/* Workaround for PR57484 on ia32: */
/* { dg-additional-options "-msse2 -mfpmath=sse" { target { ia32 && sse2_runtime } } } */
@@ -5,6 +5,7 @@
/* { dg-add-options ieee } */
/* { dg-require-effective-target float128_runtime } */
/* { dg-additional-options "-fsignaling-nans" } */
+/* { dg-skip-if "WASM does not have signaling NaNs" { wasm*-*-* } } */
/* Workaround for PR57484 on ia32: */
/* { dg-additional-options "-msse2 -mfpmath=sse" { target { ia32 && sse2_runtime } } } */
@@ -5,6 +5,7 @@
/* { dg-add-options ieee } */
/* { dg-require-effective-target float128x_runtime } */
/* { dg-additional-options "-fsignaling-nans" } */
+/* { dg-skip-if "WASM does not have signaling NaNs" { wasm*-*-* } } */
/* Workaround for PR57484 on ia32: */
/* { dg-additional-options "-msse2 -mfpmath=sse" { target { ia32 && sse2_runtime } } } */
@@ -5,6 +5,7 @@
/* { dg-add-options ieee } */
/* { dg-require-effective-target float16_runtime } */
/* { dg-additional-options "-fsignaling-nans" } */
+/* { dg-skip-if "WASM does not have signaling NaNs" { wasm*-*-* } } */
/* Workaround for PR57484 on ia32: */
/* { dg-additional-options "-msse2 -mfpmath=sse" { target { ia32 && sse2_runtime } } } */
@@ -5,6 +5,7 @@
/* { dg-add-options ieee } */
/* { dg-require-effective-target float32_runtime } */
/* { dg-additional-options "-fsignaling-nans" } */
+/* { dg-skip-if "WASM does not have signaling NaNs" { wasm*-*-* } } */
/* Workaround for PR57484 on ia32: */
/* { dg-additional-options "-msse2 -mfpmath=sse" { target { ia32 && sse2_runtime } } } */
@@ -5,6 +5,7 @@
/* { dg-add-options ieee } */
/* { dg-require-effective-target float32x_runtime } */
/* { dg-additional-options "-fsignaling-nans" } */
+/* { dg-skip-if "WASM does not have signaling NaNs" { wasm*-*-* } } */
/* Workaround for PR57484 on ia32: */
/* { dg-additional-options "-msse2 -mfpmath=sse" { target { ia32 && sse2_runtime } } } */
@@ -5,6 +5,7 @@
/* { dg-add-options ieee } */
/* { dg-require-effective-target float64_runtime } */
/* { dg-additional-options "-fsignaling-nans" } */
+/* { dg-skip-if "WASM does not have signaling NaNs" { wasm*-*-* } } */
/* Workaround for PR57484 on ia32: */
/* { dg-additional-options "-msse2 -mfpmath=sse" { target { ia32 && sse2_runtime } } } */
@@ -5,6 +5,7 @@
/* { dg-add-options ieee } */
/* { dg-require-effective-target float64x_runtime } */
/* { dg-additional-options "-fsignaling-nans" } */
+/* { dg-skip-if "WASM does not have signaling NaNs" { wasm*-*-* } } */
/* Workaround for PR57484 on ia32: */
/* { dg-additional-options "-msse2 -mfpmath=sse" { target { ia32 && sse2_runtime } } } */
new file mode 100644
@@ -0,0 +1,56 @@
+/* { dg-additional-options "-std=gnu17" } */
+
+long __attribute__((noipa))
+sink1(void)
+{
+ return 0;
+}
+long __attribute__((noipa))
+sink2(void*)
+{
+ return 0;
+}
+
+
+static inline void lstrcpynW( short *d, const short *s, int n )
+{
+ unsigned int count = n;
+
+ while ((count > 1) && *s)
+ {
+ count--;
+ *d++ = *s++;
+ }
+ if (count) *d = 0;
+}
+
+int __attribute__((noinline,noclone))
+badfunc(int u0, int u1, int u2, int u3,
+ short *fsname, unsigned int fsname_len)
+{
+ static const short ntfsW[] = {'N','T','F','S',0};
+ char superblock[2048+3300];
+ int ret = 0;
+ short *p;
+
+ if (sink1())
+ return 0;
+ p = (void *)sink1();
+ if (p != 0)
+ goto done;
+
+ sink2(superblock);
+
+ lstrcpynW(fsname, ntfsW, fsname_len);
+
+ ret = 1;
+done:
+ return ret;
+}
+
+
+int main()
+{
+ short buf[6];
+ return !badfunc(0, 0, 0, 0, buf, 6);
+}
@@ -1,5 +1,7 @@
/* { dg-additional-options "-std=gnu17" } */
-
+/* { dg-skip-if "" { wasm*-*-* } } */
+/* wasm doesn't play well with unprototyped fns when called with mismatching
+ number of args */
long (*extfunc)();
static inline void lstrcpynW( short *d, const short *s, int n )
@@ -13,4 +13,4 @@ int bar (void)
return ((struct foo *)0x1234)->i;
}
-/* { dg-final { scan-assembler "foo" { xfail nvptx-*-* } } } */
+/* { dg-final { scan-assembler "foo" { xfail nvptx-*-* wasm*-*-* } } } */
@@ -1,5 +1,6 @@
/* { dg-skip-if "" { { powerpc*-*-aix* avr-*-* *-*-vxworks* } || newlib } } */
/* { dg-skip-if "PR analyzer/107750" { *-*-solaris2* } } */
+/* { dg-skip-if "wasi-libc doesn't work well with analyzer" { wasm*-*-* } } */
#include <sys/stat.h>
#include <fcntl.h>
@@ -1,5 +1,6 @@
/* Tests for fd leak and errno handling of mktemp-family functions. */
/* { dg-additional-options "-Wno-analyzer-null-argument" } */
+/* { dg-skip-if "wasi-libc doesn't work well with analyzer" { wasm*-*-* } } */
#include <stdlib.h>
#include <fcntl.h>
@@ -1,4 +1,5 @@
/* { dg-additional-options "-Wno-analyzer-null-argument" } */
+/* { dg-skip-if "wasi-libc doesn't work well with analyzer" { wasm*-*-* } } */
#include <stdio.h>
#include <stdlib.h>
@@ -1,5 +1,6 @@
/* { dg-additional-options "-Wno-analyzer-null-argument" } */
/* { dg-prune-output "leak of file descriptor" } */
+/* { dg-skip-if "wasi-libc doesn't work well with analyzer" { wasm*-*-* } } */
#include <stdio.h>
#include <stdlib.h>
@@ -1,5 +1,6 @@
/* { dg-additional-options "-Wno-analyzer-null-argument" } */
/* { dg-prune-output "leak of file descriptor" } */
+/* { dg-skip-if "wasi-libc doesn't work well with analyzer" { wasm*-*-* } } */
#include <stdio.h>
#include <stdlib.h>
@@ -1,5 +1,6 @@
/* { dg-additional-options "-Wno-analyzer-null-argument" } */
/* { dg-prune-output "leak of file descriptor" } */
+/* { dg-skip-if "wasi-libc doesn't work well with analyzer" { wasm*-*-* } } */
#include <stdio.h>
#include <stdlib.h>
@@ -1,5 +1,6 @@
/* { dg-additional-options "-Wno-analyzer-null-argument" } */
/* { dg-prune-output "leak of file descriptor" } */
+/* { dg-skip-if "wasi-libc doesn't work well with analyzer" { wasm*-*-* } } */
#include <stdio.h>
#include <stdlib.h>
@@ -1,4 +1,5 @@
/* { dg-additional-options "-Wno-analyzer-null-argument" } */
+/* { dg-skip-if "wasi-libc doesn't work well with analyzer" { wasm*-*-* } } */
/* TODO: mktemp is deprecated per MSC24-C
(https://wiki.sei.cmu.edu/confluence/x/hNYxBQ).
@@ -5,6 +5,7 @@
/* { dg-do compile } */
/* { dg-options "-Wno-discarded-array-qualifiers" } */
/* { dg-additional-options "-fno-pie" { target pie } } */
+/* { dg-skip-if "No sections on wasm" { wasm*-*-* } } */
/* The MMIX port always switches to the .data section at the end of a file. */
/* { dg-final { scan-assembler-not "\\.data(?!\\.rel\\.ro)" { xfail powerpc*-*-aix* mmix-*-* x86_64-*-mingw* } } } */
/* { dg-final { scan-assembler-symbol-section {^_?a$} {^\.(const|rodata|srodata|sdata)|\[RO\]} } } */
@@ -8,6 +8,9 @@
// { dg-skip-if "" { "hppa*-*-hpux*" "*-*-aix*" "nvptx-*-*" } }
// { dg-skip-if PR119369 { amdgcn-*-* } }
+// WebAssembly does support undefined weak symbols, just not weakrefs
+/* { dg-skip-if "" { wasm*-*-* } } */
+
// For kernel modules and static RTPs, the loader treats undefined weak
// symbols in the same way as undefined strong symbols. The test
// therefore fails to load, so skip it.
@@ -3,6 +3,7 @@
attribute alloc_size that __builtin_object_size can make use of (or
are treated as if they were for that purpose)..
{ dg-do compile }
+ { dg-skip-if "wasm uses wasi-libc" { wasm*-*-* } }
{ dg-additional-options "-O2 -fdump-tree-optimized" } */
void sink (void*);
@@ -1,6 +1,7 @@
/* { dg-options "-O2 -Wmissing-noreturn -fgnu89-inline" } */
/* { dg-additional-options "-mno-mmx" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
/* { dg-do compile } */
+/* { dg-skip-if "Unprototyped calls not supported" { wasm*-*-* } } */
extern void abort (void);
@@ -3,7 +3,8 @@
Prefetch using some invalid rw and locality values. These must be
compile-time constants. */
-/* { dg-do run } */
+/* { dg-do run }
+ { dg-skip-if "wasm does not support prefetch" { wasm*-*-* } } */
extern void exit (int);
@@ -12,6 +12,8 @@
#if defined(__hppa) && defined(__hpux)
/* PA HP-UX doesn't have the entire C99 runtime. */
+#elif defined(__wasm32__)
+/* WebAssembly doesn't have the entire C99 runtime. */
#elif defined(__INTERIX)
/* Interix6 doesn't have the entire C99 runtime. */
#elif defined(__AVR__)
@@ -1,6 +1,7 @@
/* PR c/17308 - nonnull attribute not as useful as it could be
PR c/78673 - sprintf missing attribute nonnull on destination argument
{ dg-do "compile" }
+ { dg-skip-if "wasm uses wasi-libc" { wasm*-*-* } }
{ dg-additional-options "-O2 -Wnonnull -ftrack-macro-expansion=0 -std=c99" } */
#define va_list __builtin_va_list
@@ -1,6 +1,7 @@
/* Test __STDC_VERSION_STDINT_H__ in C23. */
/* { dg-do preprocess } */
/* { dg-options "-std=c23 -pedantic-errors -ffreestanding" } */
+/* { dg-skip-if "wasi-libc doesn't support c23" { wasm*-*-* } } */
#include <stdint.h>
@@ -11,6 +11,7 @@
/* { dg-options "-std=iso9899:1999 -pedantic-errors -fhosted" } */
/* { dg-require-effective-target ptr32plus } */
/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */
+/* { dg-skip-if "wasi-libc doesn't support int width" { wasm*-*-* } } */
#include <limits.h>
#include <stdint.h>
@@ -4,6 +4,7 @@
/* { dg-options "-std=iso9899:1999 -pedantic-errors -ffreestanding" } */
/* { dg-require-effective-target ptr32plus } */
/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */
+/* { dg-skip-if "wasi-libc doesn't support int width" { wasm*-*-* } } */
/* The test is that there are no diagnostics, so just include the
hosted version. */
@@ -3,6 +3,7 @@
conditions. */
/* { dg-do compile } */
/* { dg-options "-std=iso9899:1999 -fhosted" } */
+/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */
#include <stdint.h>
@@ -191,12 +192,14 @@
#error "PTRDIFF_MAX not usable in #if or wrong value"
#endif
+#ifndef SIGNAL_SUPPRESS
#if SIG_ATOMIC_MIN != __SIG_ATOMIC_MIN__
#error "SIG_ATOMIC_MIN not usable in #if or wrong value"
#endif
#if SIG_ATOMIC_MAX != __SIG_ATOMIC_MAX__
#error "SIG_ATOMIC_MAX not usable in #if or wrong value"
#endif
+#endif
#if SIZE_MAX != __SIZE_MAX__
#error "SIZE_MAX not usable in #if or wrong value"
@@ -3,6 +3,7 @@
conditions. Freestanding version. */
/* { dg-do compile } */
/* { dg-options "-std=iso9899:1999 -ffreestanding" } */
+/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */
/* The test is that there are no diagnostics, so just include the
hosted version. */
@@ -1,6 +1,6 @@
/* { dg-do compile }
{ dg-require-iconv "IBM1047" }
- { dg-final { scan-assembler-not "\"foobar\"" } } */
+ { dg-final { scan-assembler-not "\"foobar\"" { xfail wasm*-*-* } } } */
const char *str;
@@ -6,6 +6,7 @@
/* { dg-do compile } */
/* { dg-options "-g1" } */
+/* { dg-skip-if "wasm doesn't support -g" { wasm*-*-* } } */
int foo (int a, int b)
{
@@ -1,4 +1,5 @@
/* { dg-do compile { target inttypes_types } } */
+/* { dg-skip-if "wasi-libc does not support PRIuN" { wasm*-*-* } } */
/* { dg-options "-O2 -Wall -Wextra" } */
#include <inttypes.h>
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-skip-if "only works for ELF targets" { *-*-darwin* *-*-aix* } } */
+/* { dg-skip-if "only works for ELF targets" { *-*-darwin* *-*-aix* wasm*-*-* } } */
__attribute__ ((__symver__ ("foo@VER_2")))
__attribute__ ((__symver__ ("foo@VER_3")))
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { ! { mips64 || { aarch64*-*-* arm*-*-* i?86-*-* ia64-*-* pru-*-* sparc*-*-* x86_64-*-* } } } } } */
+/* { dg-do compile { target { ! { mips64 || { aarch64*-*-* arm*-*-* i?86-*-* ia64-*-* pru-*-* sparc*-*-* x86_64-*-* wasm*-*-* } } } } } */
/* { dg-options "-O -fdump-rtl-subreg1" } */
/* { dg-require-effective-target ilp32 } */
@@ -1,4 +1,5 @@
/* { dg-options "-I. -Winvalid-pch -g" } */
+/* { dg-skip-if "wasm doesn't support -g" { wasm*-*-* } } */
#include "valid-1.h"/* { dg-warning "created with .none. debug info, but used with" } */
/* { dg-error "No such file" "no such file" { target *-*-* } 0 } */
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-skip-if "split DWARF unsupported" { hppa*-*-hpux* powerpc*-ibm-aix* *-*-darwin* } } */
+/* { dg-skip-if "split DWARF unsupported" { hppa*-*-hpux* powerpc*-ibm-aix* *-*-darwin* wasm*-*-* } } */
/* { dg-options "-gsplit-dwarf -g3 -dA -gdwarf-4 -gno-strict-dwarf" } */
/* { dg-final { scan-assembler-times {\.section\t"?\.debug_macro} 1 } } */
/* { dg-final { scan-assembler-not {\.byte\t0x5\t[^\n\r]* Define macro strp} } } */
@@ -3,7 +3,7 @@
/* { dg-require-effective-target ptr32plus } */
/* { dg-options "-Os" } */
/* { dg-final { scan-assembler-times "2112543726\|7deadbee" 2 } } */
-/* { dg-skip-if "integer output is different here" { nvptx-*-* } } */
+/* { dg-skip-if "integer output is different here" { nvptx-*-* wasm*-*-* } } */
struct S
{
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O -fdata-sections" } */
-/* { dg-skip-if "-fdata-sections not supported" { hppa*-*-hpux* nvptx-*-* } } */
+/* { dg-skip-if "-fdata-sections not supported" { hppa*-*-hpux* nvptx-*-* wasm*-*-* } } */
int x = 1;
int x;
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-skip-if "profile-info-section" { powerpc-ibm-aix* } } */
/* { dg-options "-fprofile-arcs -fprofile-info-section -fdump-tree-optimized" } */
+/* { dg-require-effective-target named_sections } */
int foo()
{
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-std=c11 -ffreestanding" } */
/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */
+/* { dg-skip-if "wasi-libc doesn't support int width" { wasm*-*-* } } */
#include <stddef.h>
#define __STDC_WANT_IEC_60559_BFP_EXT__
@@ -2,6 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-std=c23 -ffreestanding" } */
/* { dg-additional-options "-DSIGNAL_SUPPRESS" { target { ! signal } } } */
+/* { dg-skip-if "wasi-libc doesn't support int width" { wasm*-*-* } } */
#include <stddef.h>
#include <stdint.h>
@@ -19,7 +19,7 @@ int foo (int b, int c, int d)
return a;
}
-/* { dg-final { scan-assembler-not "emutls_get_address.*emutls_get_address.*" { target { ! { "*-wrs-vxworks" "*-*-darwin8" "hppa*-*-hpux*" "i?86-*-mingw*" "x86_64-*-mingw*" visium-*-* nvptx-*-* } } } } } */
+/* { dg-final { scan-assembler-not "emutls_get_address.*emutls_get_address.*" { target { ! { "*-wrs-vxworks" "*-*-darwin8" "hppa*-*-hpux*" "i?86-*-mingw*" "x86_64-*-mingw*" visium-*-* nvptx-*-* wasm*-*-* } } } } } */
/* { dg-final { scan-assembler-not "call\tL___emutls_get_address.stub.*call\tL___emutls_get_address.stub.*" { target "*-*-darwin8" } } } */
/* { dg-final { scan-assembler-not "(b,l|bl) __emutls_get_address.*(b,l|bl) __emutls_get_address.*" { target "hppa*-*-hpux*" } } } */
/* { dg-final { scan-assembler-not "tls_lookup.*tls_lookup.*" { target *-wrs-vxworks } } } */
@@ -1,5 +1,6 @@
/* { dg-options "-fcondition-coverage -ftest-coverage -O2" } */
/* { dg-do compile } */
+/* { dg-skip-if "wasi-libc doesn't implement longjmp" { wasm*-*-* } } */
#include <stdint.h>
#include <limits.h>
@@ -39,6 +39,10 @@ if ![info exists GCOV_UNDER_TEST] {
# Initialize harness.
dg-init
+if [istarget wasm*-*-*] then {
+ return 0;
+}
+
# Delete old .gcda files.
set files [glob -nocomplain gcov*.gcda]
if { $files != "" } {
@@ -59,9 +59,12 @@ proc check_for_all_options {language gcc_options compiler_pattern as_pattern ld_
set as_options [list "additional_flags=-print-prog-name=as"]
set as_prog [lindex [gcc_target_compile "" "" "none" $as_options] 0]
if {![regexp -line -- " ${as_prog}(\\.exe)? .*$as_pattern" $gcc_output]} {
-
- fail "$test (assembler options)"
- return
+ # wasm does not use a standard assembler, its options are very different
+ # from gas and the like
+ if { ![istarget "wasm*-*-*"] } {
+ fail "$test (assembler options)"
+ return
+ }
}
# Match /collect2, /ld, or *-ld.
if {![regexp -- "(/collect2|\[-/\]ld)(\\.exe)? .*$ld_pattern" $gcc_output]} {
@@ -28,6 +28,9 @@ proc gcc_target_object_format { } {
if [info exists gcc_target_object_format_saved] {
verbose "gcc_target_object_format returning saved $gcc_target_object_format_saved" 2
+ } elseif { [istarget wasm*-*-*] } {
+ # WebAssembly has its own assembly and objerct file format.
+ set gcc_target_object_format_saved wasm
} elseif { [istarget *-*-darwin*] } {
# Darwin doesn't necessarily have objdump, so hand-code it.
set gcc_target_object_format_saved mach-o
@@ -83,7 +86,10 @@ proc gcc_target_object_format { } {
}
som {
set gcc_target_object_format_saved som
- }
+ }
+ wasm {
+ set gcc_target_object_format_saved wasm
+ }
default {
verbose "Unknown file format: $objformat" 3
set gcc_target_object_format_saved unknown
@@ -148,6 +148,7 @@ proc hidden-scan-for { symbol } {
coff { return "$symbol\[,\d\]*hidden" }
elf { return "hidden\[ \t_\]*$symbol" }
mach-o { return "private_extern\[ \t_\]*_?$symbol" }
+ wasm { return "(@sym(.import.data)? \\$$symbol|\\$$symbol \\\(@sym) (|weak |local )hidden" }
default { return "" }
}
@@ -159,6 +160,7 @@ proc weak-scan-for { symbol } {
switch $objformat {
default { return "weak\[^ \t\]*\[ \t\]_?$symbol" }
+ wasm { return "(@sym(.import.data)? \\$$symbol|\\$$symbol \\\(@sym) weak" }
}
}
@@ -351,6 +351,7 @@ proc check_weak_available { } {
a.out { return 1 }
mach-o { return 1 }
som { return 1 }
+ wasm { return 1 }
unknown { return -1 }
default { return 0 }
}
@@ -496,6 +497,10 @@ proc check_visibility_available { what_kind } {
# be determined.
proc check_alias_available { } {
+ if { [istarget wasm*-*-*] } {
+ return 0;
+ }
+
global tool
return [check_cached_effective_target alias_available {
@@ -651,7 +656,8 @@ proc check_effective_target_trampolines { } {
|| [istarget nvptx-*-*]
|| [istarget ft32-*-*]
|| [istarget pru-*-*]
- || [istarget bpf-*-*] } {
+ || [istarget bpf-*-*]
+ || [istarget wasm*-*-*] } {
return 0;
}
return 1
@@ -723,6 +729,9 @@ proc dg-effective-target-value { effective_target } {
# Return 1 if signal.h is supported.
proc check_effective_target_signal { } {
+ if { [istarget wasm*-*-*] } {
+ return 0
+ }
if [target_info exists gcc,signal_suppress] {
return 0
}
@@ -993,7 +1002,7 @@ proc add_options_for_check_function_bodies { flags } {
# Return 1 if indirect jumps are supported, 0 otherwise.
proc check_effective_target_indirect_jumps {} {
- if { [istarget nvptx-*-*] || [istarget bpf-*-*] } {
+ if { [istarget nvptx-*-*] || [istarget bpf-*-*] || [istarget wasm*-*-*] } {
return 0
}
return 1
@@ -1002,7 +1011,7 @@ proc check_effective_target_indirect_jumps {} {
# Return 1 if nonlocal goto is supported, 0 otherwise.
proc check_effective_target_nonlocal_goto {} {
- if { [istarget nvptx-*-*] || [istarget bpf-*-*] } {
+ if { [istarget nvptx-*-*] || [istarget bpf-*-*] || [istarget wasm*-*-*] } {
return 0
}
return 1
@@ -1020,7 +1029,8 @@ proc check_effective_target_global_constructor {} {
# Return 1 if taking label values is supported, 0 otherwise.
proc check_effective_target_label_values {} {
- if { [istarget nvptx-*-*] || [target_info exists gcc,no_label_values] } {
+ if { [istarget nvptx-*-*] || [istarget wasm*-*-*]
+ || [target_info exists gcc,no_label_values] } {
return 0
}
@@ -1047,7 +1057,7 @@ proc check_effective_target_return_address {} {
return 0
}
# No notion of return address in eBPF.
- if { [istarget bpf-*-*] } {
+ if { [istarget bpf-*-*] || [istarget wasm*-*-*] } {
return 0
}
# It could be supported on amdgcn, but isn't yet.
@@ -1062,7 +1072,7 @@ proc check_effective_target_return_address {} {
# with K&R C function declarations.
proc check_effective_target_untyped_assembly {} {
- if { [istarget nvptx-*-*] } {
+ if { [istarget wasm*-*-*] || [istarget nvptx-*-*] } {
return 0
}
return 1
@@ -1277,6 +1287,9 @@ proc check_effective_target_fgnu_tm {} {
# Return 1 if the target supports mmap, 0 otherwise.
proc check_effective_target_mmap {} {
+ if [istarget wasm*-*-*] {
+ return 0;
+ }
return [check_function_available "mmap"]
}
@@ -4919,6 +4932,9 @@ proc check_effective_target_vect_intdouble_cvt { } {
#Return 1 if we're supporting __int128 for target, 0 otherwise.
proc check_effective_target_int128 { } {
+ if [istarget wasm*-*-*] {
+ return 0;
+ }
return [check_no_compiler_messages int128 object {
int dummy[
#ifndef __SIZEOF_INT128__
@@ -12226,7 +12242,8 @@ proc check_effective_target_lto { } {
return 0
}
if { [istarget nvptx-*-*]
- || [istarget amdgcn-*-*] } {
+ || [istarget amdgcn-*-*]
+ || [istarget wasm*-*-*] } {
return 0;
}
return [check_no_compiler_messages lto object {
@@ -13035,6 +13052,7 @@ proc check_effective_target_fenv_exceptions_long_double {} {
proc check_effective_target_exceptions {} {
if { [istarget amdgcn*-*-*]
|| [istarget bpf-*-*]
+ || [istarget wasm*-*-*]
|| [istarget nvptx-*-*] } {
return 0
}
@@ -14050,7 +14068,7 @@ foreach N {df} {
# Return 1 if this target uses an LLVM assembler and/or linker
proc check_effective_target_llvm_binutils { } {
return [check_cached_effective_target llvm_binutils {
- expr { [istarget amdgcn*-*-*]
+ expr { [istarget amdgcn*-*-*] || [istarget wasm*-*-*]
|| [check_effective_target_offload_gcn] }}]
}
@@ -14126,7 +14144,7 @@ proc check_effective_target_large_initializer { } {
# in the assembly.
proc check_effective_target_non_strict_prototype { } {
- if { [istarget nvptx*-*-*] } {
+ if { [istarget wasm*-*-*] || [istarget nvptx*-*-*] } {
return 0
}
@@ -14328,6 +14346,9 @@ proc check_effective_target_lra { } {
# Return 1 if 'asm goto' with outputs is supported, 0 otherwise.
proc check_effective_target_asm_goto_with_outputs { } {
+ if { [istarget wasm*-*-*] } {
+ return 0
+ }
if { [istarget nvptx-*-*] } {
return 1
}