1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-30 04:50:08 +00:00

Handle special case of INT3.

10 failures.
This commit is contained in:
Thomas Harte 2023-09-28 15:34:33 -04:00
parent ae4a588de3
commit 6936cf1819

View File

@ -146,8 +146,7 @@ std::string to_string(
- (NSArray<NSString *> *)testFiles { - (NSArray<NSString *> *)testFiles {
NSString *path = [NSString stringWithUTF8String:TestSuiteHome]; NSString *path = [NSString stringWithUTF8String:TestSuiteHome];
NSSet *allowList = [NSSet setWithArray:@[ NSSet *allowList = [NSSet setWithArray:@[
// @"E8.json.gz", // @"E4.json.gz",
// @"E9.json.gz",
]]; ]];
// Unofficial opcodes; ignored for now. // Unofficial opcodes; ignored for now.
@ -343,21 +342,24 @@ std::string to_string(
// //
// SEPARATELY: The test suite retains a distinction between SHL and SAL, which the decoder doesn't. So consider that // SEPARATELY: The test suite retains a distinction between SHL and SAL, which the decoder doesn't. So consider that
// a potential point of difference. // a potential point of difference.
bool adjust_si = true; //
bool adjust_sal = false; // Also, the decoder treats INT3 and INT 3 as the same thing. So allow for a meshing of those.
while(!isEqual && (adjust_sal || adjust_si)) { int adjustment = 7;
while(!isEqual && adjustment) {
NSString *alteredName = test[@"name"]; NSString *alteredName = test[@"name"];
if(adjust_si) { if(adjustment & 4) {
alteredName = [alteredName stringByReplacingOccurrencesOfString:@"bp+si" withString:@"bp+di"]; alteredName = [alteredName stringByReplacingOccurrencesOfString:@"bp+si" withString:@"bp+di"];
} }
if(adjust_sal) { if(adjustment & 2) {
alteredName = [alteredName stringByReplacingOccurrencesOfString:@"shl" withString:@"sal"]; alteredName = [alteredName stringByReplacingOccurrencesOfString:@"shl" withString:@"sal"];
} }
if(adjustment & 1) {
alteredName = [alteredName stringByReplacingOccurrencesOfString:@"int3 " withString:@"int 03h"];
}
isEqual = compare_decoding(alteredName); isEqual = compare_decoding(alteredName);
adjust_sal ^= adjust_si; --adjustment;
adjust_si ^= true;
} }
XCTAssert(isEqual, "%@ doesn't match %@ or similar, was %@ within %@", test[@"name"], [decodings anyObject], hex_instruction(), file); XCTAssert(isEqual, "%@ doesn't match %@ or similar, was %@ within %@", test[@"name"], [decodings anyObject], hex_instruction(), file);