feat: add benchmark-programs — 58 telecom COBOL test programs

作为子目录纳入系统,与核心测试管道协同

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
NB-076
2026-06-25 09:53:21 +08:00
parent 50f9f0f52f
commit 94400d50d4
278 changed files with 44125 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
# 05-branch-if — IF Branch Program
## 电信业务场景
料金阶梯判定。根据通话时长进行IF条件分支,将用量分为低额/中额/高额三个料金段,分别写入不同输出文件。
Demonstrates GnuCOBOL IF branching patterns:
- **IF 2-way (ELSE)**: Test DATA1 prefix for "SPECIAL"
- **IF 3-way (ELSE IF)**: Branch DATA2 value to three output files
- **Compound AND/OR**: Combine multiple conditions in one IF
- **88-level condition name**: Implicit condition test on KEY field
- **IF nested 3 levels**: Nested IF checks on DATA2 and KEY
## Files
| File | Purpose |
|------|---------|
| `main-05-branch-if.cbl` | COBOL program (fixed format) |
| `data-gen.sh` | Generate 12-records FILE-IN.DAT |
| `run.sh` | Compile, run, verify outputs |
## Input Record
| Field | Type | Length |
|-------|------|--------|
| KEY | PIC X | 10 |
| DATA1 | PIC X | 20 |
| DATA2 | PIC 9 | 10 |
## Branch Logic
| Condition | Output File |
|-----------|-------------|
| DATA2 < 1000 | FILE-OUT-A.DAT |
| DATA2 >= 1000 AND <= 5000 | FILE-OUT-B.DAT |
| DATA2 > 5000 | FILE-OUT-C.DAT |