summaryrefslogtreecommitdiff
path: root/support/regression/tests/bug-3570.c
blob: df43df480b428ec6fbc706ac41d7712833f86af3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* bug-3570.c
   A comparison between pointers resulting in an invalid compile time error during AST proccessing.
 */

#include <testfwk.h>

unsigned char *LevelMapGet(void) { return 0; }

typedef struct game_data {
    unsigned char *current;
} MapData;


MapData mapData;

void
testBug(void) {
    if ( mapData.current + 5 >= LevelMapGet() )
        return;

    if ( &mapData.current[5] >= LevelMapGet() ) // This comparison failed to compile
        return;
}