mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-05 17:39:16 +00:00
IRBuilder: Add unit tests for construction of globals with address space
This was forgotten in r240113. Thanks Eric for paying attention. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240124 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e2d0c66ce5
commit
4b77d12064
@ -320,5 +320,17 @@ TEST_F(IRBuilderTest, InsertExtractElement) {
|
||||
EXPECT_EQ(Elt2, X2);
|
||||
}
|
||||
|
||||
TEST_F(IRBuilderTest, CreateGlobalStringPtr) {
|
||||
IRBuilder<> Builder(BB);
|
||||
|
||||
auto String1a = Builder.CreateGlobalStringPtr("TestString", "String1a");
|
||||
auto String1b = Builder.CreateGlobalStringPtr("TestString", "String1b", 0);
|
||||
auto String2 = Builder.CreateGlobalStringPtr("TestString", "String2", 1);
|
||||
auto String3 = Builder.CreateGlobalString("TestString", "String3", 2);
|
||||
|
||||
EXPECT_TRUE(String1a->getType()->getPointerAddressSpace() == 0);
|
||||
EXPECT_TRUE(String1b->getType()->getPointerAddressSpace() == 0);
|
||||
EXPECT_TRUE(String2->getType()->getPointerAddressSpace() == 1);
|
||||
EXPECT_TRUE(String3->getType()->getPointerAddressSpace() == 2);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user