[llvm] [TableGen] Allow emitter callbacks to use `const RecordKeeper &` (PR #104716)
Pierre van Houtryve via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 23 04:10:23 PDT 2024
" + sys::path::filename(Record.getInputFilename()),"
In-Reply-To: <llvm.org/llvm/llvm-project/pull/104716 at github.com>
================
@@ -59,4 +59,12 @@ TEST(FunctionRefTest, SFINAE) {
EXPECT_EQ("string", returns([] { return "hello"; }));
}
+TEST(FunctionRefTest, Equality) {
+ function_ref<int()> X = [] { return 1; };
+ function_ref<int()> Y = [] { return 2; };
+ EXPECT_TRUE(!(X == Y));
----------------
Pierre-vh wrote:
```suggestion
EXPECT_FALSE(X == Y);
EXPECT_TRUE(X != Y);
```
also test something like
```
const auto Lambda = []() { return 0 };
function_ref<int()> A(Lambda), B (Lambda);
EXPECT_TRUE(A == B);
EXPECT_FALSE(A != B);
```
I think != should be automatically available but if it isn't then it's fine, don't bother testing it
```
https://github.com/llvm/llvm-project/pull/104716
More information about the llvm-commits
mailing list