[PATCH] D122268: Add PointerType analysis for DirectX backend

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 25 10:51:36 PDT 2022


kuhar added inline comments.


================
Comment at: llvm/unittests/Target/DirectX/PointerTypeAnalysisTests.cpp:56-57
+  Type *FnTy = FunctionType::get(Type::getInt64Ty(Context), {I8Ptr}, false);
+  llvm::SmallVector<Type *, 2> Ex = {I8Ptr, FnTy};
+  EXPECT_TRUE(CompareResults(Ex, Map));
+}
----------------
kuhar wrote:
> I think it might be more helpful to first extract values from the map and then check, something like:
> ```
> EXPECT_THAT(Ex, UnorderedElementsAreArray(make_second_range(Extracted)));
> ```
> 
> (I haven't tried to compile it, you may need to tweak this a bit.)
> 
> The main difference is that gmock macros explain what went wrong when check fail, e.g., which array elements were different.
correction, more like: `EXPECT_THAT(make_second_range(Map), UnorderedElementsAre(I8Ptr, FnTy));`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122268/new/

https://reviews.llvm.org/D122268



More information about the llvm-commits mailing list