1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-22 16:33:48 +00:00

Added test for #564

This commit is contained in:
jespergravgaard 2020-11-04 09:09:38 +01:00
parent f6c32196ed
commit bc3731dc5d
2 changed files with 27 additions and 0 deletions

View File

@ -44,6 +44,12 @@ public class TestPrograms {
public TestPrograms() {
}
// https://gitlab.com/camelot/kickc/-/issues/564
//@Test
//public void testUnknownVarProblem() throws IOException, URISyntaxException {
// compileAndCompare("unknown-var-problem.c", log().verboseParse());
//}
@Test
public void testFunctionPointerProblem1() throws IOException, URISyntaxException {
compileAndCompare("function-pointer-problem-1.c");

View File

@ -0,0 +1,21 @@
// Demonstrates problem with assigning a pointer to pointer inside inline function
// https://gitlab.com/camelot/kickc/-/issues/564
typedef char uint8_t;
uint8_t sieveFlags[128];
void main() {
clearSieveData();
}
inline void clearSieveData() {
uint8_t *p = sieveFlags;
uint8_t **pp = &p + 1;
for (register uint8_t i: 0..0x1f) {
for (register uint8_t j: 0..0xff) {
*(p + j) = 1;
}
(*pp)++;
}
}