mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-12-28 01:29:44 +00:00
add test case
This commit is contained in:
parent
4aec255c95
commit
33764d4466
@ -4855,6 +4855,11 @@ public class TestPrograms {
|
||||
compileAndCompare("condition-type-mismatch.c");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIssue594() throws IOException, URISyntaxException {
|
||||
compileAndCompare("issue-594-case.c");
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
public static void setUp() {
|
||||
TmpDirManager.init(new File("").toPath());
|
||||
@ -4993,8 +4998,8 @@ public class TestPrograms {
|
||||
success &= helper.testOutput(baseFileName, ".cfg", program.getGraph().toString(program));
|
||||
success &= helper.testOutput(baseFileName, ".log", program.getLog().toString());
|
||||
if(!success) {
|
||||
//System.out.println("\nCOMPILE LOG");
|
||||
//System.out.println(program.getLog().toString());
|
||||
System.out.println("\nCOMPILE LOG");
|
||||
System.out.println(program.getLog().toString());
|
||||
fail("Output does not match reference!");
|
||||
}
|
||||
// Save the ASM fragment caches (if there are any changes)
|
||||
|
20
src/test/kc/issue-594-case.c
Normal file
20
src/test/kc/issue-594-case.c
Normal file
@ -0,0 +1,20 @@
|
||||
enum _substate_hosts {
|
||||
HOSTS,
|
||||
DEVICES,
|
||||
DONE
|
||||
};
|
||||
|
||||
typedef enum _substate_hosts SubState;
|
||||
|
||||
#define ORIGIN_HOST_SLOTS 2
|
||||
#define ORIGIN_DEVICE_SLOTS 13
|
||||
|
||||
const char * OUT = 0x8000;
|
||||
|
||||
void main() {
|
||||
SubState substate = HOSTS;
|
||||
SubState *ss = &substate;
|
||||
|
||||
char x = (*ss == DEVICES ? ORIGIN_DEVICE_SLOTS : ORIGIN_HOST_SLOTS);
|
||||
*OUT = x;
|
||||
}
|
Loading…
Reference in New Issue
Block a user