forked from gcc-mirror/gcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* execute/980223.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18210 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
robertl
committed
Feb 23, 1998
1 parent
8353683
commit d46250c
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
typedef struct { long addr; long type; } object; | ||
|
||
object bar (object blah) | ||
{ | ||
abort(); | ||
} | ||
|
||
object foo (object x, object y) | ||
{ | ||
object z = *(object*)(x.addr); | ||
if (z.type & 64) | ||
{ | ||
y = *(object*)(z.addr+sizeof(object)); | ||
z = *(object*)(z.addr); | ||
if (z.type & 64) | ||
y = bar(y); | ||
} | ||
return y; | ||
} | ||
|
||
int nil; | ||
object cons1[2] = { {(long) &nil, 0}, {(long) &nil, 0} }; | ||
object cons2[2] = { {(long) &cons1, 64}, {(long) &nil, 0} }; | ||
|
||
main() | ||
{ | ||
object x = {(long) &cons2, 64}; | ||
object y = {(long) &nil, 0}; | ||
object three = foo(x,y); | ||
return 0; | ||
} |