Skip to content

Commit 8c68fa5

Browse files
committed
Add test case
1 parent e23f5fb commit 8c68fa5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Test/FastPathAlloc.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ + (instancetype)alloc
9191
}
9292
@end
9393

94+
Class getClassNamed(char *name)
95+
{
96+
return nil;
97+
}
98+
9499
int main(void)
95100
{
96101
called = NO;
@@ -124,6 +129,11 @@ int main(void)
124129
called = NO;
125130
[[NoInit2 alloc] init];
126131
assert(!called);
132+
133+
// Look up a non-existing class to test if fast-path
134+
// implementations can handle receivers that are nil
135+
[getClassNamed("flibble") alloc];
136+
[[getClassNamed("flibble") alloc] init];
127137
}
128138

129139
#endif

0 commit comments

Comments
 (0)