Day 16 of 30 · Clang frontend
Write focused diagnostic tests
- Time
- About 150 minutes: 40 reading, 80 lab, 20 testing, 10 notes.
- Prerequisites
- Day 15: Learn the LLVM regression test workflow
Toolchain: current-main build
Use build/bin/clang++ and build/bin/llvm-lit from your llvm-main checkout, not whichever clang++ is first on PATH. Reproduce upstream behavior on current main and record the commit SHA. Setup guide
Learn
- Positive cases, negative cases, language modes and regression intent.
Read Reading
- R10 · LLVM testing guide
Test-writing guidance · 20 min - Your llvm-project checkout
Two nearby SemaCXX tests · 20 min
Reading budgets cover selected sections, not whole chapters. Link to the book; this site does not reproduce it.
Build Build or investigate
- Choose an existing diagnostic, not a new bug claim.
- Build a scratch test with one invalid program and one valid boundary case.
- Check whether C++17 and C++20 need distinct expectations.
- Use
-verifyannotations and keep each case small.
Done when
A stable scratch regression test that fails when its important expectation is removed or changed.
Recall question
How could an overly broad diagnostic match allow the wrong behavior to pass?
Completion checks
Progress tracking needs JavaScript. The lesson above is complete without it.
Notes
Saved only in this browser. Keep it short enough to finish in ten minutes; none of the prompts are required. All notes, export and import