Commit a0a2017
committed
[CIR] Add crash test cases for const_cast l-value and cleanup null fixups
This commit adds two minimal test cases to clang/test/CIR/crashes/ for
known NYI (not yet implemented) features that cause crashes:
1. const-cast-lvalue.cpp - Tests CXXConstCastExpr l-value emission
- Triggers assertion at CIRGenExpr.cpp:2764
- Error: 'Use emitCastLValue below, remove me when adding testcase'
- Minimal reproducer showing const_cast in struct member functions
2. cleanup-892-null-fixups.cpp - Tests null fixup popping in cleanups
- Triggers UNREACHABLE at CIRGenCleanup.cpp:892
- Missing implementation of EHScopeStack::popNullFixups()
- Minimal reproducer with destructors and early returns
Both test cases were reduced from multi-megabyte preprocessed files
(from LLVM self-host build failures) down to <30 lines using creduce.
These tests are marked XFAIL and serve as regression tests for when
these features are implemented.
Test Plan:
- Verified both tests trigger their respective crashes with -fclangir
- Tests follow existing pattern in clang/test/CIR/crashes/
- Both tests are properly formatted and minimal1 parent d0cac23 commit a0a2017
File tree
2 files changed
+59
-0
lines changed- clang/test/CIR/crashes
2 files changed
+59
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments