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

Reading budgets cover selected sections, not whole chapters. Link to the book; this site does not reproduce it.

Build Build or investigate

  1. Choose an existing diagnostic, not a new bug claim.
  2. Build a scratch test with one invalid program and one valid boundary case.
  3. Check whether C++17 and C++20 need distinct expectations.
  4. Use -verify annotations 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.

Required to complete day 16

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