net: lwm2m: Test compilation with data cache enabled

This should allow an issue such as #86681 to be found earlier for a not
widely used config.

Signed-off-by: Etienne de Maricourt <edmecomemail@gmail.com>
diff --git a/samples/net/lwm2m_client/overlay-data-cache.conf b/samples/net/lwm2m_client/overlay-data-cache.conf
new file mode 100644
index 0000000..e7c410f
--- /dev/null
+++ b/samples/net/lwm2m_client/overlay-data-cache.conf
@@ -0,0 +1,5 @@
+CONFIG_ZCBOR=y
+CONFIG_ZCBOR_CANONICAL=y
+CONFIG_LWM2M_RW_SENML_CBOR_SUPPORT=y
+CONFIG_POSIX_TIMERS=y
+CONFIG_LWM2M_RESOURCE_DATA_CACHE_SUPPORT=y
diff --git a/samples/net/lwm2m_client/sample.yaml b/samples/net/lwm2m_client/sample.yaml
index 5c8f0eb..a3f21d8 100644
--- a/samples/net/lwm2m_client/sample.yaml
+++ b/samples/net/lwm2m_client/sample.yaml
@@ -64,6 +64,18 @@
     tags:
       - net
       - lwm2m
+  sample.net.lwm2m_client.data_cache:
+    harness: net
+    depends_on: netif
+    extra_args: EXTRA_CONF_FILE=overlay-data-cache.conf
+    platform_allow:
+      - qemu_x86
+      - native_sim
+    integration_platforms:
+      - qemu_x86
+    tags:
+      - net
+      - lwm2m
   sample.net.lwm2m_client.wnc_m14a2a:
     harness: net
     extra_args: SHIELD=wnc_m14a2a