1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-14 05:05:45 +00:00
cc65/test/err/cc65091001.c
2022-04-16 19:51:48 +02:00

31 lines
547 B
C

/*
!!DESCRIPTION!! invalid binary operation on pointer, should not compile
!!ORIGIN!! testsuite
!!LICENCE!! Public Domain
!!AUTHOR!!
*/
/* > Gets stuck in an endless loop with -O. */
#include <assert.h>
#include <string.h>
#include <stdio.h>
typedef unsigned char U8;
char var = 0xf0;
char fn(char bar)
{
char* ptr = (char*)0xf;
var |= ptr; /* should throw an error here */
while (var > bar)
var <<= 1;
return 0;
}
int main() {
fn(0x7f);
assert(0);
printf("it works :)\n");
return 0;
}