Fixes 51982. Adds a missing CreatePointerCast and allocates a global in
the correct address space.
Test case derived from https://github.com/ROCm-Developer-Tools/aomp/\
blob/aomp-dev/test/smoke/nest_call_par2/nest_call_par2.c by deleting
parts while checking the assertion failure still occurred.
Replacing this constructor call with one that specifies the address space does not solve this bug. It probably makes it more widespread as now all Ident variables would be in AS1 as opposed to only some of them.
Likewise, only casting the newly created GlobalVariable to addrspace(0) does not help, as the one that was returned by return Ident = &GV;
The patch here that ensures the result of getOrCreateIdent is in same address space as IdentPtr (i.e. none) looks necessary regardless of whether the global variable is created in AS1 or ASnone.
I tested this by hardcoding 1