Publish VCC Plus OSS source distribution for 3.6.2 build 60

This commit is contained in:
Brian Holman committed 2026-11-13 00:14:03 -07:00
commit c652a5276d
1192 files changed
+272368

No files matched your search

@@ -0,0 +1,38 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Exercise the actual built compiler rule; expose its private entry only in
// this test translation unit. Vendor sources and normal objects stay unchanged.
#include "util.h"
#include <utility>
#include <functional>
#define private public
#include "ASMText.h"
#undef private
#include <iostream>
#include <stdexcept>
void check(const char* first, const char* middleOp, const char* middle, const char* last, bool expectRemoval) {
ASMText text(true);
text.ins("LDB", first); text.ins(middleOp, middle); text.ins("LDB", last);
const bool removed = text.removeUselessLdaOrLdb(0);
if (removed != expectRemoval) throw std::runtime_error(std::string(first) + "; " + middleOp + " " + middle + "; LDB " + last);
}
int main() {
try {
check("5,U", "LDX", "#array", "D,X", false);
check("5,U", "LDX", "#array", "B,X", false);
check("5,U", "LDX", "#array", "[D,X]", false);
check("5,U", "LDX", "#array", "[B,X]", false);
check("5,U", "LDX", "D,Y", ",X", false);
check("5,U", "LDX", "B,Y", ",X", false);
check("5,U", "LDX", "[D,Y]", ",X", false);
check("5,U", "LEAX", "D,Y", ",X", false);
check("5,U", "LEAX", "B,Y", ",X", false);
check(",S+", "LDX", "#array", ",X", false);
check(",--X", "LDX", "#array", ",X", false);
check("[,Y++]", "LDX", "#array", ",X", false);
check("[,--U]", "LDX", "#array", ",X", false);
check("5,U", "LDX", "#array", ",X", true);
check("5,U", "LEAX", "4,Y", "4,X", true);
std::cout << "PASS indexed-load rule: 13 dependency/side-effect guards, 2 safe removals\n";
return 0;
} catch (const std::exception& error) { std::cerr << error.what() << '\n'; return 1; }
}