When the expression used to initialise this has a pointer type,
check the address space of the pointee type instead of the pointer
type to decide whether an address space cast is required.
It is the pointee type that carries the address space qualifier.
Details
Details
Diff Detail
Diff Detail
- Repository
- rC Clang
Event Timeline
Comment Actions
I would suggest an IR test, especially since what you want to achieve is addrspacecast in IR output. We use AST dump only if there is no other good way to test something. In fact we already have a test with similar logic that tests various OpenCL address spaces: test/CodeGenOpenCLCXX/addrspace-of-this.cl. I think it should be reasonable enough to extend it.
test/CodeGenOpenCLCXX/addrspace-of-this.cl | ||
---|---|---|
94 ↗ | (On Diff #197617) | Ok I think we should regex name of call registers or may be even prevent checking it if it's not required. The same applies to other places btw. |
136 ↗ | (On Diff #197617) | Shouldn't %call5 just be [[CALL]]? If not I see little value in checking the name... |
Comment Actions
Most of these are pre-existing issues with the tests but I agree they're worth fixing. I'll update the tests.