[IR] Remove unit tests for typed pointers (NFC)
authorNikita Popov <npopov@redhat.com>
Wed, 12 Jul 2023 13:10:04 +0000 (15:10 +0200)
committerNikita Popov <npopov@redhat.com>
Wed, 12 Jul 2023 13:10:33 +0000 (15:10 +0200)
llvm/unittests/IR/ConstantsTest.cpp
llvm/unittests/IR/TypesTest.cpp

index 577d9e9..265a702 100644 (file)
@@ -467,9 +467,8 @@ TEST(ConstantsTest, BuildConstantDataVectors) {
   }
 }
 
-void bitcastToGEPHelper(bool useOpaquePointers) {
+TEST(ConstantsTest, BitcastToGEP) {
   LLVMContext Context;
-  Context.setOpaquePointers(useOpaquePointers);
   std::unique_ptr<Module> M(new Module("MyModule", Context));
 
   auto *i32 = Type::getInt32Ty(Context);
@@ -481,17 +480,8 @@ void bitcastToGEPHelper(bool useOpaquePointers) {
       new GlobalVariable(*M, S, false, GlobalValue::ExternalLinkage, nullptr);
   auto *PtrTy = PointerType::get(i32, 0);
   auto *C = ConstantExpr::getBitCast(G, PtrTy);
-  if (Context.supportsTypedPointers()) {
-    EXPECT_EQ(cast<ConstantExpr>(C)->getOpcode(), Instruction::BitCast);
-  } else {
-    /* With opaque pointers, no cast is necessary. */
-    EXPECT_EQ(C, G);
-  }
-}
-
-TEST(ConstantsTest, BitcastToGEP) {
-  bitcastToGEPHelper(true);
-  bitcastToGEPHelper(false);
+  /* With opaque pointers, no cast is necessary. */
+  EXPECT_EQ(C, G);
 }
 
 bool foldFuncPtrAndConstToNull(LLVMContext &Context, Module *TheModule,
index 2944957..eba808a 100644 (file)
@@ -36,10 +36,9 @@ TEST(TypesTest, LayoutIdenticalEmptyStructs) {
 }
 
 TEST(TypesTest, CopyPointerType) {
-  LLVMContext COpaquePointers;
-  COpaquePointers.setOpaquePointers(true);
+  LLVMContext C;
 
-  PointerType *P1 = PointerType::get(COpaquePointers, 1);
+  PointerType *P1 = PointerType::get(C, 1);
   EXPECT_TRUE(P1->isOpaque());
   PointerType *P1C = PointerType::getWithSamePointeeType(P1, 1);
   EXPECT_EQ(P1, P1C);
@@ -47,18 +46,6 @@ TEST(TypesTest, CopyPointerType) {
   PointerType *P1C0 = PointerType::getWithSamePointeeType(P1, 0);
   EXPECT_NE(P1, P1C0);
   EXPECT_TRUE(P1C0->isOpaque());
-
-  LLVMContext CTypedPointers;
-  CTypedPointers.setOpaquePointers(false);
-  Type *Int8 = Type::getInt8Ty(CTypedPointers);
-  PointerType *P2 = PointerType::get(Int8, 1);
-  EXPECT_FALSE(P2->isOpaque());
-  PointerType *P2C = PointerType::getWithSamePointeeType(P2, 1);
-  EXPECT_EQ(P2, P2C);
-  EXPECT_FALSE(P2C->isOpaque());
-  PointerType *P2C0 = PointerType::getWithSamePointeeType(P2, 0);
-  EXPECT_NE(P2, P2C0);
-  EXPECT_FALSE(P2C0->isOpaque());
 }
 
 TEST(TypesTest, TargetExtType) {