On 14/01/2022 12:20, Tobias Burnus wrote:
> On 14.01.22 12:55, Jakub Jelinek via Fortran wrote:
>> If we want to check intptr_t, we should guard the dg-error with
>> "" { target { lp64 || llp64 } }
>> or so.
> 
> Well, if we want to use intptr_t, we could use be explicitly as with:
> 
>   use iso_c_binding, only: c_intptr_t
>   ! use omp_lib, only: omp_allocator_handle_kind
>   ...  ('implicit none' etc.)
>   integer, parameter :: omp_allocator_handle_kind = c_intptr_t
>   ...
>   integer(kind=omp_allocator_handle_kind)
> 
> (@Abid: The 'use omp_lib' line is commented as in gcc/testsuite/*/gomp/,
> the OpenMP module/header from libgomp is not available - and then a
> stub parameter is created.)
> 
>> Otherwise yes, we can add some other kind and hope it is not the
>> same as omp_allocator_handle_kind.  Or we can do both,
>> keep the current one with the target lp64 || llp64 and
>> add another one with some integer(kind=1).
> 
> For just testing something invalid, I think it makes more sense to just set 
> it to kind=1.
> 
> For checking the valid value, using c_intptr_t seems to make more sense than 
> restricting it to (l)l64.

Problem was with the literal 0 having same kind as c_intptr_t for m32. So there 
was no diagnostic in
that case. I am going to change it 0_1 to make the test more robust.

Thanks,
-- 
Hafiz Abid Qadeer
Mentor, a Siemens Business

Reply via email to