SDL: Verify that the %p format specifier works for 64-bit pointers (d622c)

From d622c3c9cc4e36356af3edd70f58c5e0de2c36db Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sat, 16 Dec 2023 21:40:05 -0800
Subject: [PATCH] Verify that the %p format specifier works for 64-bit pointers

(cherry picked from commit 7f75178908355046e37d908648c44cf4d4625f09)
---
 test/testautomation_stdlib.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/test/testautomation_stdlib.c b/test/testautomation_stdlib.c
index 9228b17d2af2..66ddc5de5005 100644
--- a/test/testautomation_stdlib.c
+++ b/test/testautomation_stdlib.c
@@ -187,6 +187,13 @@ int stdlib_snprintf(void *arg)
     SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: '%s', got: '%s'", expected, text);
     SDLTest_AssertCheck(result == SDL_strlen(expected), "Check result value, expected: %d, got: %d", (int)SDL_strlen(expected), result);
 
+    if (sizeof(void *) >= 8) {
+        result = SDL_snprintf(text, sizeof(text), "%p", (void *)0x1ba07bddf60L);
+        expected = "0x1ba07bddf60";
+        SDLTest_AssertPass("Call to SDL_snprintf(text, sizeof(text), \"%%p\", 0x1ba07bddf60)");
+        SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: '%s', got: '%s'", expected, text);
+        SDLTest_AssertCheck(result == SDL_strlen(expected), "Check result value, expected: %d, got: %d", (int)SDL_strlen(expected), result);
+    }
     return TEST_COMPLETED;
 }