From edd482f310f4ec46310e7c2c82c88dad64b5a4ff Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz Date: Wed, 20 May 2020 22:15:18 +0100 Subject: [PATCH] TESTSUITE: Fix Wconversion-null*.C tests for aarch64 -mabi=ilp32 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. --- .../g++.dg/warn/Wconversion-null-2.C | 20 +++++++++++++++++-- gcc/testsuite/g++.dg/warn/Wconversion-null.C | 20 +++++++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/gcc/testsuite/g++.dg/warn/Wconversion-null-2.C b/gcc/testsuite/g++.dg/warn/Wconversion-null-2.C index 0f5bf58bd5d..3ba756e596b 100644 --- a/gcc/testsuite/g++.dg/warn/Wconversion-null-2.C +++ b/gcc/testsuite/g++.dg/warn/Wconversion-null-2.C @@ -3,7 +3,12 @@ #include -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 @@ -15,7 +20,18 @@ template 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() { diff --git a/gcc/testsuite/g++.dg/warn/Wconversion-null.C b/gcc/testsuite/g++.dg/warn/Wconversion-null.C index 4cac2671116..4c68d233450 100644 --- a/gcc/testsuite/g++.dg/warn/Wconversion-null.C +++ b/gcc/testsuite/g++.dg/warn/Wconversion-null.C @@ -3,7 +3,12 @@ #include -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 @@ -15,7 +20,18 @@ template 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() { -- 2.30.2