TESTSUITE: Fix Wconversion-null*.C tests for aarch64 -mabi=ilp32
authorJozef Lawrynowicz <jozef.l@mittosystems.com>
Wed, 20 May 2020 21:15:18 +0000 (22:15 +0100)
committerJozef Lawrynowicz <jozef.l@mittosystems.com>
Wed, 20 May 2020 21:29:01 +0000 (22:29 +0100)
This fixes regressions for aarch64 with -mabi=ilp32 of the
Wconversion-null*.C tests, introduced by 92ea8e1bccc.

The "g (int)" declaration is required for that target where
sizeof(int) == sizeof(long) == sizeof(void *).

To handle the msp430/-mlarge case, an explicit declaration of
"g (__int20)" is required.

gcc/testsuite/ChangeLog:

* g++.dg/warn/Wconversion-null-2.C: Add explicit declarations for l()
and g() with int, long, long long and __int20 arguments.
* g++.dg/warn/Wconversion-null.C: Likewise.

gcc/testsuite/g++.dg/warn/Wconversion-null-2.C
gcc/testsuite/g++.dg/warn/Wconversion-null.C

index 0f5bf58..3ba756e 100644 (file)
@@ -3,7 +3,12 @@
 
 #include <cstddef>
 
-void g(__INTPTR_TYPE__) {}
+void g(int) {}
+void g(long) {}
+void g(long long) {}
+#ifdef __MSP430X_LARGE__
+void g(__int20) {}
+#endif
 extern void g(void*);
 
 template <int I>
@@ -15,7 +20,18 @@ template <class T>
 void l(T);
 
 template <>
-void l(__INTPTR_TYPE__) {}
+void l(int) {}
+
+template <>
+void l(long) {}
+
+template <>
+void l(long long) {}
+
+#ifdef __MSP430X_LARGE__
+template <>
+void l(__int20) {}
+#endif
 
 void warn_for_NULL()
 {
index 4cac267..4c68d23 100644 (file)
@@ -3,7 +3,12 @@
 
 #include <cstddef>
 
-void g(__INTPTR_TYPE__) {}
+void g(int) {}
+void g(long) {}
+void g(long long) {}
+#ifdef __MSP430X_LARGE__
+void g(__int20) {}
+#endif
 extern void g(void*);
 
 template <int I>
@@ -15,7 +20,18 @@ template <class T>
 void l(T);
 
 template <>
-void l(__INTPTR_TYPE__) {}
+void l(int) {}
+
+template <>
+void l(long) {}
+
+template <>
+void l(long long) {}
+
+#ifdef __MSP430X_LARGE__
+template <>
+void l(__int20) {}
+#endif
 
 int main()
 {