@@ -1051,29 +1051,6 @@ define void @foo() {
10511051 auto *Call = cast<sandboxir::CallInst>(&*It++);
10521052 // Check classof(), creation.
10531053 auto *GO = cast<sandboxir::GlobalObject>(Call->getCalledOperand ());
1054- // Check getAlignment().
1055- EXPECT_EQ (GO->getAlignment (), LLVMGO->getAlignment ());
1056- // Check getAlign().
1057- EXPECT_EQ (GO->getAlign (), LLVMGO->getAlign ());
1058- // Check setAlignment().
1059- auto OrigMaybeAlign = GO->getAlign ();
1060- auto NewMaybeAlign = MaybeAlign (128 );
1061- EXPECT_NE (NewMaybeAlign, OrigMaybeAlign);
1062- GO->setAlignment (NewMaybeAlign);
1063- EXPECT_EQ (GO->getAlign (), NewMaybeAlign);
1064- GO->setAlignment (OrigMaybeAlign);
1065- EXPECT_EQ (GO->getAlign (), OrigMaybeAlign);
1066- // Check getGlobalObjectSubClassData().
1067- EXPECT_EQ (GO->getGlobalObjectSubClassData (),
1068- LLVMGO->getGlobalObjectSubClassData ());
1069- // Check setGlobalObjectSubClassData().
1070- auto OrigGOSCD = GO->getGlobalObjectSubClassData ();
1071- auto NewGOSCD = 1u ;
1072- EXPECT_NE (NewGOSCD, OrigGOSCD);
1073- GO->setGlobalObjectSubClassData (NewGOSCD);
1074- EXPECT_EQ (GO->getGlobalObjectSubClassData (), NewGOSCD);
1075- GO->setGlobalObjectSubClassData (OrigGOSCD);
1076- EXPECT_EQ (GO->getGlobalObjectSubClassData (), OrigGOSCD);
10771054 // Check hasSection().
10781055 EXPECT_EQ (GO->hasSection (), LLVMGO->hasSection ());
10791056 // Check getSection().
@@ -1284,6 +1261,16 @@ define void @foo() {
12841261 EXPECT_EQ (GV0->getCodeModelRaw (), LLVMGV0->getCodeModelRaw ());
12851262 // Check getCodeModel().
12861263 EXPECT_EQ (GV0->getCodeModel (), LLVMGV0->getCodeModel ());
1264+ // Check getAlign().
1265+ EXPECT_EQ (GV0->getAlign (), LLVMGV0->getAlign ());
1266+ // Check setAlignment().
1267+ auto OrigMaybeAlign = GV0->getAlign ();
1268+ auto NewMaybeAlign = MaybeAlign (128 );
1269+ EXPECT_NE (NewMaybeAlign, OrigMaybeAlign);
1270+ GV0->setAlignment (NewMaybeAlign);
1271+ EXPECT_EQ (GV0->getAlign (), NewMaybeAlign);
1272+ GV0->setAlignment (OrigMaybeAlign);
1273+ EXPECT_EQ (GV0->getAlign (), OrigMaybeAlign);
12871274}
12881275
12891276TEST_F (SandboxIRTest, GlobalAlias) {
@@ -1855,6 +1842,17 @@ void @foo0(i32 %arg0, i32 %arg1) {
18551842)IR" );
18561843 }
18571844#endif // NDEBUG
1845+
1846+ // Check getAlign().
1847+ EXPECT_EQ (F0->getAlign (), F0->getAlign ());
1848+ // Check setAlignment().
1849+ auto OrigMaybeAlign = F0->getAlign ();
1850+ auto NewMaybeAlign = MaybeAlign (128 );
1851+ EXPECT_NE (NewMaybeAlign, OrigMaybeAlign);
1852+ F0->setAlignment (NewMaybeAlign);
1853+ EXPECT_EQ (F0->getAlign (), NewMaybeAlign);
1854+ F0->setAlignment (OrigMaybeAlign);
1855+ EXPECT_EQ (F0->getAlign (), OrigMaybeAlign);
18581856}
18591857
18601858TEST_F (SandboxIRTest, Module) {
0 commit comments