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:
parent
f6c32196ed
commit
bc3731dc5d
@ -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");
|
||||
|
21
src/test/kc/unknown-var-problem.c
Normal file
21
src/test/kc/unknown-var-problem.c
Normal 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)++;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user