samples/tests: filter based on toolchain features

Do not run with toolchains that do not support newlib.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
diff --git a/samples/net/sockets/big_http_download/sample.yaml b/samples/net/sockets/big_http_download/sample.yaml
index 9aa551e..9aa697c 100644
--- a/samples/net/sockets/big_http_download/sample.yaml
+++ b/samples/net/sockets/big_http_download/sample.yaml
@@ -3,7 +3,7 @@
   name: big_http_download
 tests:
   test:
-    platform_exclude: esp32 qemu_x86_64 # No newlib
+    filter: TOOLCHAIN_HAS_NEWLIB == 1
     harness: net
     min_ram: 32
     min_flash: 128
diff --git a/samples/net/sockets/dumb_http_server/sample.yaml b/samples/net/sockets/dumb_http_server/sample.yaml
index 4091854..d4fb7b4 100644
--- a/samples/net/sockets/dumb_http_server/sample.yaml
+++ b/samples/net/sockets/dumb_http_server/sample.yaml
@@ -3,7 +3,7 @@
   name: socket_dumb_http_server
 tests:
   test:
-    platform_exclude: esp32 qemu_x86_64 # No newlib
+    filter: TOOLCHAIN_HAS_NEWLIB == 1
     harness: net
     min_ram: 32
     min_flash: 96
diff --git a/samples/net/sockets/http_get/sample.yaml b/samples/net/sockets/http_get/sample.yaml
index 039a62d..decb99b 100644
--- a/samples/net/sockets/http_get/sample.yaml
+++ b/samples/net/sockets/http_get/sample.yaml
@@ -3,7 +3,7 @@
   name: socket_http_get
 tests:
   test:
-    platform_exclude: esp32 qemu_x86_64 # No newlib
+    filter: TOOLCHAIN_HAS_NEWLIB == 1
     harness: net
     min_ram: 32
     min_flash: 80
diff --git a/tests/lib/mem_alloc/testcase.yaml b/tests/lib/mem_alloc/testcase.yaml
index 7bcbbe0..b537c23 100644
--- a/tests/lib/mem_alloc/testcase.yaml
+++ b/tests/lib/mem_alloc/testcase.yaml
@@ -6,5 +6,5 @@
   libraries.libc.newlib:
     extra_args: CONF_FILE=prj_newlib.conf
     arch_exclude: posix
-    platform_exclude: esp32 qemu_x86_64 # No newlib
+    filter: TOOLCHAIN_HAS_NEWLIB == 1
     tags: clib newlib
diff --git a/tests/misc/test_build/testcase.yaml b/tests/misc/test_build/testcase.yaml
index 21b68f7..253c153 100644
--- a/tests/misc/test_build/testcase.yaml
+++ b/tests/misc/test_build/testcase.yaml
@@ -7,7 +7,7 @@
     build_only: true
     extra_args: CONF_FILE=newlib.conf
     tags: build_test
-    platform_exclude: esp32 qemu_x86_64
+    filter: TOOLCHAIN_HAS_NEWLIB == 1
   test_runtime_nmi:
     arch_whitelist: arm
     build_only: true