1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-22 12:30:41 +00:00

Merge pull request #1434 from mrdudz/test1423

Test for pr #1423
This commit is contained in:
Oliver Schmidt 2021-03-20 02:01:46 +01:00 committed by GitHub
commit 203c4da15b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

41
test/val/pr1423.c Normal file
View File

@ -0,0 +1,41 @@
/* pr #1423 - Codegen fix for certain cases of object addresses as boolean */
unsigned char fails = 0;
void test1(void)
{
int a;
while (&a) {
return;
}
fails++;
return;
}
void test2(void)
{
int a;
do {
return;
} while (&a);
fails++;
return;
}
void test3(void)
{
int a;
for (;&a;) {
return;
}
fails++;
return;
}
int main(void)
{
test1();
test2();
test3();
return fails;
}