Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
9a57c5d3
Commit
9a57c5d3
authored
23 years ago
by
Ovidiu Predescu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added. Check sending +load to categories, in addition to classes.
From-SVN: r43080
parent
cd7894a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
108 additions
and
0 deletions
+108
-0
gcc/testsuite/objc/execute/load-3.m
+108
-0
No files found.
gcc/testsuite/objc/execute/load-3.m
0 → 100644
View file @
9a57c5d3
/*
load-3.m
Author: Ovidiu Predescu <ovidiu@cup.hp.com>
Date: June 3, 2001
Test if the +load methods are invoked, and are invoked in the
proper order.
*/
#include <objc/objc.h>
#include <objc/Object.h>
@interface
A
:
Object
@end
@interface
B
:
A
@end
static
a_load
=
0
;
static
b_load
=
0
;
static
a_category_load
=
0
;
static
b_category_load
=
0
;
@implementation
A
(
Category
)
+
(
void
)
load
{
a_category_load
=
1
;
printf
(
"+[A(Category) load]
\n
"
);
if
(
a_load
!=
1
)
{
printf
(
"+load for A(Category) invoked before A's!
\n
"
);
abort
();
}
}
@end
@implementation
B
(
Category
)
+
(
void
)
load
{
b_category_load
=
1
;
printf
(
"+[B(Category) load]
\n
"
);
if
(
b_load
!=
1
)
{
printf
(
"+load for B(Category) invoked before B!
\n
"
);
abort
();
}
}
@end
@implementation
B
+
(
void
)
load
{
b_load
=
1
;
printf
(
"+[B load]
\n
"
);
if
(
a_load
!=
1
)
{
printf
(
"+load for B invoked before A's!
\n
"
);
abort
();
}
if
(
b_category_load
!=
0
)
{
printf
(
"+load for B invoked after B(Category)!
\n
"
);
abort
();
}
}
@end
@implementation
A
+
(
void
)
load
{
a_load
=
1
;
printf
(
"+[A load]
\n
"
);
if
(
a_category_load
!=
0
)
{
printf
(
"+load for A(Category) invoked before A!
\n
"
);
abort
();
}
if
(
b_load
!=
0
)
{
printf
(
"+load for A invoked after B!
\n
"
);
abort
();
}
if
(
b_category_load
!=
0
)
{
printf
(
"+load for B(Category) invoked before A and B!
\n
"
);
abort
();
}
}
@end
int
main
(
void
)
{
if
(
a_load
+
b_load
+
a_category_load
+
b_category_load
!=
4
)
{
printf
(
"Not all +load methods invoked!
\n
"
);
abort
();
}
return
0
;
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment