Commit Graph

3 Commits

Author SHA1 Message Date
saqut a4fb3cfc4f fix(tc): string sıralama operatörleri derleme zamanında bloklandı (B5)
Sorun: TypeChecker < > <= >= için tip kontrolü yapmıyordu; string
operandlarda VM sessizce intValue=0 karşılaştırıyordu.

Düzeltme: karşılaştırma bloğu ikiye ayrıldı:
  == / !=  → string dahil herhangi tip (değişmedi)
  < > <= >= → isNumeric() kontrolü; string veya diğer sayısal-olmayan
              tipler E003 üretir, VM'e hiç ulaşmaz

Aritmetik (+ - * / %) zaten sayısal-olmayan tipler için E003 üretiyordu;
doğrulandı, değiştirilmedi.

Altyapı: cmake/run_golden_error.cmake + CMakeLists.txt'e .compile_error
desteği — derleme hatası bekleyen negatif golden testler için.

Testler (19/19 yeşil):
  - string/ordering_error: string < → E003 (negatif test)
  - string/equality: string == / != çalışmaya devam ediyor (regresyon)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 16:26:20 +03:00
abdussamedulutas 913b42026c test(opt): #104/#105 beyaz-kutu IR testleri — folding ve DCE doğru katmanda
- ir.hpp: --optimized bayrağı ile OptimizationManager entegrasyonu
- ir_generator.cpp: hasDirectValue/directIntValue okunuyor (katlanmış literal IR'da 0 veriyordu)
- run_golden.cmake: OPTIMIZED=1 parametresi ile --optimized desteği
- CMakeLists.txt: *.ir_opt.expected → saqut ir --optimized otomatik keşif
- opt/folding.ir_opt.expected: 2+3*4 → LOAD_CONST 14 (katlama kanıtı)
- opt/dce.ir_opt.expected: LOAD_CONST 99 + CALLHOST print silindi (DCE kanıtı)
- Yanıltıcı run-output testleri (folding.expected, dce.expected) kaldırıldı
2026-06-18 22:47:31 +03:00
abdussamedulutas 85d955ec62 test: golden-test koşucusu + Value audit + saqut ir pipeline fix
closes #113, #114, #75

- cmake/run_golden.cmake: BINARY/SOURCE/EXPECTED ile çalışan karşılaştırma betiği
- CMakeLists.txt: enable_testing(), golden test otomatik keşif (CONFIGURE_DEPENDS),
  unit_tests (tests/run.sh) ctest entegrasyonu
- tests/golden/: fibonacci, string, arithmetic — 4/4 yeşil (negatif doğrulama da geçti)
- value.hpp: stale yorum temizlendi, toString() eklendi, switch exhaustive hale getirildi
- ir.hpp: TypeChecker + StructuralValidator eklendi — run pipeline ile artık eşit
2026-06-18 22:31:26 +03:00