gcc/testsuite/gcc.dg: Fix LLP64 targets
authorJonathan Yong <10walls@gmail.com>
Tue, 14 Feb 2023 10:29:05 +0000 (10:29 +0000)
committerJonathan Yong <10walls@gmail.com>
Sun, 12 Mar 2023 01:56:17 +0000 (01:56 +0000)
gcc/testsuite/ChangeLog:

* gcc.dg/builtins-69.c: Use (long )*regex pattern to
allow long long instead of just long.
* gcc.dg/pr80163.c: Use __INTPTR_TYPE__ for LLP64 tagets.

Signed-off-by: Jonathan Yong <10walls@gmail.com>
gcc/testsuite/gcc.dg/builtins-69.c
gcc/testsuite/gcc.dg/pr80163.c

index 26dfb3b..b754b5d 100644 (file)
@@ -14,7 +14,7 @@ int test_index (void)
 /* PR middle-end/86202 - ICE in get_range_info calling an invalid memcpy()
    declaration */
 
-void *memcpy (void *, void *, __SIZE_TYPE__ *);   /* { dg-warning "conflicting types for built-in function .memcpy.; expected .void \\\*\\\(void \\\*, const void \\\*, \(long \)?unsigned int\\\)." } */
+void *memcpy (void *, void *, __SIZE_TYPE__ *);   /* { dg-warning "conflicting types for built-in function .memcpy.; expected .void \\\*\\\(void \\\*, const void \\\*, \(long \)*unsigned int\\\)." } */
 
 void test_memcpy (void *p, void *q, __SIZE_TYPE__ *r)
 {
index 37a7abd..f65955c 100644 (file)
@@ -2,6 +2,7 @@
 /* { dg-do compile { target int128 } } */
 /* { dg-options "-O0" } */
 
+typedef __INTPTR_TYPE__ intptr_t;
 void bar (void);
 
 __int128_t *
@@ -10,7 +11,7 @@ foo (void)
 a:
   bar ();
 b:;
-  static __int128_t d = (long) &&a - (long) &&b;       /* { dg-error "initializer element is not computable at load time" } */
+  static __int128_t d = (intptr_t) &&a - (intptr_t) &&b;       /* { dg-error "initializer element is not computable at load time" } */
   return &d;
 }