diff --git a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_1.c b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_1.c
index 03b2b93df07..450fbb887e3 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_1.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_1.c
@@ -6,9 +6,9 @@
 #define TEST_LOOP(NAME, OUTTYPE, INTYPE, MASKTYPE)		\
   void __attribute__ ((noinline, noclone))			\
   NAME##_2 (OUTTYPE *__restrict dest, INTYPE *__restrict src,	\
-	    MASKTYPE *__restrict cond, int n)			\
+	    MASKTYPE *__restrict cond, intptr_t n)		\
   {								\
-    for (int i = 0; i < n; ++i)					\
+    for (intptr_t i = 0; i < n; ++i)				\
       if (cond[i])						\
 	dest[i] = src[i * 2] + src[i * 2 + 1];			\
   }
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_2.c b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_2.c
index 87ac3178be0..499abd7c99a 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_2.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_2.c
@@ -6,9 +6,9 @@
 #define TEST_LOOP(NAME, OUTTYPE, INTYPE, MASKTYPE)		\
   void __attribute__ ((noinline, noclone))			\
   NAME##_3 (OUTTYPE *__restrict dest, INTYPE *__restrict src,	\
-	    MASKTYPE *__restrict cond, int n)			\
+	    MASKTYPE *__restrict cond, intptr_t n)		\
   {								\
-    for (int i = 0; i < n; ++i)					\
+    for (intptr_t i = 0; i < n; ++i)				\
       if (cond[i])						\
 	dest[i] = (src[i * 3]					\
 		   + src[i * 3 + 1]				\
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_3.c b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_3.c
index 54806f93ad9..a5ce0716322 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_3.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_3.c
@@ -6,9 +6,9 @@
 #define TEST_LOOP(NAME, OUTTYPE, INTYPE, MASKTYPE)		\
   void __attribute__ ((noinline, noclone))			\
   NAME##_4 (OUTTYPE *__restrict dest, INTYPE *__restrict src,	\
-	    MASKTYPE *__restrict cond, int n)			\
+	    MASKTYPE *__restrict cond, intptr_t n)		\
   {								\
-    for (int i = 0; i < n; ++i)					\
+    for (intptr_t i = 0; i < n; ++i)				\
       if (cond[i])						\
 	dest[i] = (src[i * 4]					\
 		   + src[i * 4 + 1]				\
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_4.c b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_4.c
index 4c73004f68d..bdfea964f88 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_4.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_4.c
@@ -6,9 +6,9 @@
 #define TEST_LOOP(NAME, OUTTYPE, INTYPE, MASKTYPE)		\
   void __attribute__ ((noinline, noclone))			\
   NAME##_3 (OUTTYPE *__restrict dest, INTYPE *__restrict src,	\
-	    MASKTYPE *__restrict cond, int n)			\
+	    MASKTYPE *__restrict cond, intptr_t n)		\
   {								\
-    for (int i = 0; i < n; ++i)					\
+    for (intptr_t i = 0; i < n; ++i)				\
       if (cond[i])						\
 	dest[i] = src[i * 3] + src[i * 3 + 2];			\
   }
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_5.c b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_5.c
index 2a33ee81d1a..299955a8a93 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_5.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_5.c
@@ -6,9 +6,9 @@
 #define TEST_LOOP(NAME, OUTTYPE, INTYPE, MASKTYPE)		\
   void __attribute__ ((noinline, noclone))			\
   NAME##_4 (OUTTYPE *__restrict dest, INTYPE *__restrict src,	\
-	    MASKTYPE *__restrict cond, int n)			\
+	    MASKTYPE *__restrict cond, intptr_t n)		\
   {								\
-    for (int i = 0; i < n; ++i)					\
+    for (intptr_t i = 0; i < n; ++i)				\
       if (cond[i])						\
 	dest[i] = src[i * 4] + src[i * 4 + 3];			\
   }
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_6.c b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_6.c
index d4542eca0f7..999c7b52422 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_6.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_6.c
@@ -6,9 +6,9 @@
 #define TEST_LOOP(NAME, OUTTYPE, INTYPE, MASKTYPE)		\
   void __attribute__ ((noinline, noclone))			\
   NAME##_2 (OUTTYPE *__restrict dest, INTYPE *__restrict src,	\
-	    MASKTYPE *__restrict cond, int n)			\
+	    MASKTYPE *__restrict cond, intptr_t n)		\
   {								\
-    for (int i = 0; i < n; ++i)					\
+    for (intptr_t i = 0; i < n; ++i)				\
       if (cond[i])						\
 	dest[i] = src[i * 2];					\
   }
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_7.c b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_7.c
index 9d26e15c0d9..57d71ed460a 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_7.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_7.c
@@ -6,9 +6,9 @@
 #define TEST_LOOP(NAME, OUTTYPE, INTYPE, MASKTYPE)		\
   void __attribute__ ((noinline, noclone))			\
   NAME##_3 (OUTTYPE *__restrict dest, INTYPE *__restrict src,	\
-	    MASKTYPE *__restrict cond, int n)			\
+	    MASKTYPE *__restrict cond, intptr_t n)		\
   {								\
-    for (int i = 0; i < n; ++i)					\
+    for (intptr_t i = 0; i < n; ++i)				\
       if (cond[i])						\
 	dest[i] = src[i * 3] + src[i * 3 + 1];			\
   }
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_8.c b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_8.c
index 17fd4c0a079..1ead3ba695e 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_8.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_8.c
@@ -6,9 +6,9 @@
 #define TEST_LOOP(NAME, OUTTYPE, INTYPE, MASKTYPE)		\
   void __attribute__ ((noinline, noclone))			\
   NAME##_4 (OUTTYPE *__restrict dest, INTYPE *__restrict src,	\
-	    MASKTYPE *__restrict cond, int n)			\
+	    MASKTYPE *__restrict cond, intptr_t n)		\
   {								\
-    for (int i = 0; i < n; ++i)					\
+    for (intptr_t i = 0; i < n; ++i)				\
       if (cond[i])						\
 	dest[i] = src[i * 4] + src[i * 4 + 2];			\
   }
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_1.c b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_1.c
index a75a694f9c3..39fae68a5d0 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_1.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_1.c
@@ -6,9 +6,9 @@
 #define TEST_LOOP(NAME, OUTTYPE, INTYPE, MASKTYPE)		\
   void __attribute__ ((noinline, noclone))			\
   NAME##_2 (OUTTYPE *__restrict dest, INTYPE *__restrict src,	\
-	    MASKTYPE *__restrict cond, INTYPE bias, int n)	\
+	    MASKTYPE *__restrict cond, INTYPE bias, intptr_t n)	\
   {								\
-    for (int i = 0; i < n; ++i)					\
+    for (intptr_t i = 0; i < n; ++i)				\
       {								\
 	INTYPE value = src[i] + bias;				\
 	if (cond[i])						\
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_2.c b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_2.c
index 0fd35f2ff52..0fe9b993402 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_2.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_2.c
@@ -6,9 +6,9 @@
 #define TEST_LOOP(NAME, OUTTYPE, INTYPE, MASKTYPE)		\
   void __attribute__ ((noinline, noclone))			\
   NAME##_3 (OUTTYPE *__restrict dest, INTYPE *__restrict src,	\
-	    MASKTYPE *__restrict cond, INTYPE bias, int n)	\
+	    MASKTYPE *__restrict cond, INTYPE bias, intptr_t n)	\
   {								\
-    for (int i = 0; i < n; ++i)					\
+    for (intptr_t i = 0; i < n; ++i)				\
       {								\
 	INTYPE value = src[i] + bias;				\
 	if (cond[i])						\
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_3.c b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_3.c
index 1765d54a483..a9430870eee 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_3.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_3.c
@@ -6,9 +6,9 @@
 #define TEST_LOOP(NAME, OUTTYPE, INTYPE, MASKTYPE)		\
   void __attribute__ ((noinline, noclone))			\
   NAME##_4 (OUTTYPE *__restrict dest, INTYPE *__restrict src,	\
-	    MASKTYPE *__restrict cond, INTYPE bias, int n)	\
+	    MASKTYPE *__restrict cond, INTYPE bias, intptr_t n)	\
   {								\
-    for (int i = 0; i < n; ++i)					\
+    for (intptr_t i = 0; i < n; ++i)				\
       {								\
 	INTYPE value = src[i] + bias;				\
 	if (cond[i])						\
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_4.c b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_4.c
index 59e9ee49c4a..d3f0216406d 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_4.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_4.c
@@ -6,15 +6,15 @@
 #define TEST_LOOP(NAME, OUTTYPE, INTYPE, MASKTYPE)		\
   void __attribute__ ((noinline, noclone))			\
   NAME##_2 (OUTTYPE *__restrict dest, INTYPE *__restrict src,	\
-	    MASKTYPE *__restrict cond, int n)			\
+	    MASKTYPE *__restrict cond, intptr_t n)		\
   {								\
-    for (int i = 0; i < n; ++i)					\
+    for (intptr_t i = 0; i < n; ++i)				\
       {								\
 	if (cond[i] < 8)					\
 	  dest[i * 2] = src[i];					\
 	if (cond[i] > 2)					\
 	  dest[i * 2 + 1] = src[i];				\
-	}							\
+      }								\
   }
 
 #define TEST2(NAME, OUTTYPE, INTYPE) \
