[llvm] d4714b3 - [OperationsTest] Convert to opaque pointers (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 5 02:14:49 PST 2023
Author: Nikita Popov
Date: 2023-01-05T11:14:31+01:00
New Revision: d4714b339eeadbe9e067053fd3b1da8bb57ef071
URL: https://github.com/llvm/llvm-project/commit/d4714b339eeadbe9e067053fd3b1da8bb57ef071
DIFF: https://github.com/llvm/llvm-project/commit/d4714b339eeadbe9e067053fd3b1da8bb57ef071.diff
LOG: [OperationsTest] Convert to opaque pointers (NFC)
Added:
Modified:
llvm/unittests/FuzzMutate/OperationsTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/FuzzMutate/OperationsTest.cpp b/llvm/unittests/FuzzMutate/OperationsTest.cpp
index 91f4f492686d..d4c589d74b03 100644
--- a/llvm/unittests/FuzzMutate/OperationsTest.cpp
+++ b/llvm/unittests/FuzzMutate/OperationsTest.cpp
@@ -214,17 +214,17 @@ TEST(OperationsTest, SplitEHBlock) {
LLVMContext Ctx;
const char *SourceCode =
- "declare i32* @f()"
+ "declare ptr @f()"
"declare i32 @personality_function()"
- "define i32* @test() personality i32 ()* @personality_function {\n"
+ "define ptr @test() personality ptr @personality_function {\n"
"entry:\n"
- " %val = invoke i32* @f()\n"
+ " %val = invoke ptr @f()\n"
" to label %normal unwind label %exceptional\n"
"normal:\n"
- " ret i32* %val\n"
+ " ret ptr %val\n"
"exceptional:\n"
" %landing_pad4 = landingpad token cleanup\n"
- " ret i32* undef\n"
+ " ret ptr undef\n"
"}";
auto M = parseAssembly(SourceCode, Ctx);
@@ -302,9 +302,9 @@ TEST(OperationsTest, GEPPointerOperand) {
LLVMContext Ctx;
const char *SourceCode =
+ "%opaque = type opaque\n"
"declare void @f()\n"
- "define void @test() {\n"
- " %v = bitcast void ()* @f to i64 (i8 addrspace(4)*)*\n"
+ "define void @test(%opaque %o) {\n"
" %a = alloca i64, i32 10\n"
" ret void\n"
"}";
@@ -316,11 +316,11 @@ TEST(OperationsTest, GEPPointerOperand) {
Function &F = *M->getFunction("test");
BasicBlock &BB = *F.begin();
- // Don't match %v
- ASSERT_FALSE(Descr.SourcePreds[0].matches({}, &*BB.begin()));
+ // Don't match %o
+ ASSERT_FALSE(Descr.SourcePreds[0].matches({}, &*F.arg_begin()));
// Match %a
- ASSERT_TRUE(Descr.SourcePreds[0].matches({}, &*std::next(BB.begin())));
+ ASSERT_TRUE(Descr.SourcePreds[0].matches({}, &*BB.begin()));
}
TEST(OperationsTest, ExtractAndInsertValue) {
More information about the llvm-commits
mailing list