[PATCH] D109290: [OpaquePtr] Forbid mixing typed and opaque pointers
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 8 01:12:28 PDT 2021
nikic added a comment.
For most codegen tests (that produce assembly), output for opaque pointers is the same, so that's an easy case :) For IR tests that contain pointers but don't do anything opaque pointer specific, an idea I had was to use these two run lines:
; RUN: opt -S -passes=xxx -opaque-pointers < %s | FileCheck %s
; RUN: opt -S -passes=xxx < %s | opt -S -opaque-pointers | FileCheck %s
What the second line does is run the test with typed pointers and then strip pointer types afterwards, which should usually give it the same output as working with opaque pointers from the start. This way we won't be testing the exact output under typed pointers anymore, but we do test that all pointer types are consistent (due to verifier after first `opt` invocation), and I think that's all that really matters.
This should allow us to gradually enable opaque pointer testing while ensuring that we're not missing any typed pointer bitcasts.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109290/new/
https://reviews.llvm.org/D109290
More information about the llvm-commits
mailing list