Add ccop_triggers test binaries for decompiler ccall rewriter tests#163
Open
Add ccop_triggers test binaries for decompiler ccall rewriter tests#163
Conversation
Precompiled x86_64 and i386 binaries exercising every VEX condition-code operation (ccop) type, used by angr's test_ccop_triggers integration tests. Sources and build script in tests_src/ccop_triggers/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
zardus
added a commit
to angr/angr
that referenced
this pull request
Feb 24, 2026
Move source files and precompiled binaries to the angr/binaries repo
(tests_src/ccop_triggers/ and tests/{x86_64,i386}/ccop_triggers/).
Update test_ccop_triggers.py to discover binaries via tests.common.bin_location
following the standard angr test pattern.
Companion PR: angr/binaries#163
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a ccop_triggers corpus: C sources + a build script to produce precompiled i386/x86_64 ELF binaries that exercise VEX condition-code operation (ccop) patterns for decompiler/rewriter testing.
Changes:
- Added
tests_src/ccop_triggers/*C sources to trigger specific ccop/condition/width combinations. - Added
tests_src/ccop_triggers/build.shandSTATUS.mdto document/rebuild the corpus. - Added precompiled trigger binaries under
tests/x86_64/ccop_triggers/andtests/i386/ccop_triggers/.
Reviewed changes
Copilot reviewed 12 out of 66 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests_src/ccop_triggers/ccop_common.h | Common typedefs + NOINLINE + g_sink declaration used across trigger programs. |
| tests_src/ccop_triggers/ccop_add.c | ADD-based triggers across conditions/sizes, including overflow and some asm goto branches. |
| tests_src/ccop_triggers/ccop_sub.c | SUB/CMP-based triggers across conditions/sizes. |
| tests_src/ccop_triggers/ccop_logic.c | LOGIC (test/and) triggers and some asm goto conditional branches. |
| tests_src/ccop_triggers/ccop_shl_shr.c | SHL/SHR triggers across conditions/sizes using C shifts. |
| tests_src/ccop_triggers/ccop_umul_smul.c | UMUL/SMUL overflow triggers via __builtin_mul_overflow. |
| tests_src/ccop_triggers/ccop_inc_dec.c | INC/DEC triggers using C ops and asm goto, relying on compiler tuning to emit inc/dec. |
| tests_src/ccop_triggers/ccop_adc_sbb.c | ADC/SBB triggers via __int128 (amd64) and 32-bit pair / asm goto helpers (i386). |
| tests_src/ccop_triggers/ccop_copy.c | CC_OP_COPY triggers via pushf/popf + branch on restored flags. |
| tests_src/ccop_triggers/ccop_rflags_c.c | amd64-only carry-extraction patterns for amd64g_calculate_rflags_c. |
| tests_src/ccop_triggers/build.sh | Build matrix for emitting multiple optimized variants for both amd64 and i386. |
| tests_src/ccop_triggers/STATUS.md | Documentation describing intended coverage and build outputs. |
| tests/i386/ccop_triggers/ccop_adc_sbb_O1 | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_adc_sbb_O2 | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_adc_sbb_Os | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_add_O1 | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_add_O2 | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_add_Os | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_copy_O1 | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_copy_O2 | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_copy_Os | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_inc_dec_O1_incdec | Precompiled i386 trigger binary variant (inc/dec forcing). |
| tests/i386/ccop_triggers/ccop_inc_dec_O2_haswell | Precompiled i386 trigger binary variant (haswell tuning). |
| tests/i386/ccop_triggers/ccop_inc_dec_Os_incdec | Precompiled i386 trigger binary variant (inc/dec forcing). |
| tests/i386/ccop_triggers/ccop_logic_O1 | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_logic_O2 | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_logic_Os | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_rflags_c_O1 | Precompiled i386 binary for rflags_c source (appears to be a stub due to __x86_64__ guards). |
| tests/i386/ccop_triggers/ccop_rflags_c_O2 | Precompiled i386 binary for rflags_c source (appears to be a stub due to __x86_64__ guards). |
| tests/i386/ccop_triggers/ccop_rflags_c_Os | Precompiled i386 binary for rflags_c source (appears to be a stub due to __x86_64__ guards). |
| tests/i386/ccop_triggers/ccop_shl_shr_O1 | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_shl_shr_O2 | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_shl_shr_Os | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_sub_O1 | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_sub_O2 | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_sub_Os | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_umul_smul_O1 | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_umul_smul_O2 | Precompiled i386 trigger binary variant. |
| tests/i386/ccop_triggers/ccop_umul_smul_Os | Precompiled i386 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_adc_sbb_O1 | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_adc_sbb_O2 | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_adc_sbb_Os | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_add_O1 | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_add_O2 | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_add_Os | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_copy_O1 | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_copy_O2 | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_copy_Os | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_inc_dec_O1_incdec | Precompiled amd64 trigger binary variant (inc/dec forcing). |
| tests/x86_64/ccop_triggers/ccop_inc_dec_O2_haswell | Precompiled amd64 trigger binary variant (haswell tuning). |
| tests/x86_64/ccop_triggers/ccop_inc_dec_Os_incdec | Precompiled amd64 trigger binary variant (inc/dec forcing). |
| tests/x86_64/ccop_triggers/ccop_logic_O1 | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_logic_O2 | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_logic_Os | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_rflags_c_O1 | Precompiled amd64 rflags_c trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_rflags_c_O2 | Precompiled amd64 rflags_c trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_rflags_c_Os | Precompiled amd64 rflags_c trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_shl_shr_O1 | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_shl_shr_O2 | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_shl_shr_Os | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_sub_O1 | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_sub_O2 | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_sub_Os | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_umul_smul_O1 | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_umul_smul_O2 | Precompiled amd64 trigger binary variant. |
| tests/x86_64/ccop_triggers/ccop_umul_smul_Os | Precompiled amd64 trigger binary variant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests_src/ccop_triggers/build.sh
Outdated
Comment on lines
+3
to
+5
| # Build all ccop trigger binaries for amd64 and i386. | ||
| # Usage: cd tests/analyses/decompiler/ccop_triggers && bash build.sh | ||
| # |
There was a problem hiding this comment.
The usage hint points to tests/analyses/decompiler/ccop_triggers, but this script lives under tests_src/ccop_triggers. This is likely to mislead anyone trying to rebuild the binaries; update the usage line (and any other path references) to match the actual repo layout.
zardus
added a commit
to angr/angr
that referenced
this pull request
Feb 24, 2026
Move source files and precompiled binaries to the angr/binaries repo
(tests_src/ccop_triggers/ and tests/{x86_64,i386}/ccop_triggers/).
Update test_ccop_triggers.py to discover binaries via tests.common.bin_location
following the standard angr test pattern.
Companion PR: angr/binaries#163
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Feb 25, 2026
56 hand-written C functions across 5 tiers:
- T1: control flow (switch, loops, conditionals, early return)
- T2: types (widening, truncation, casts, bitfields, bools)
- T3: memory (arrays, structs, pointers, unions, matrices)
- T4: calling (static calls, function pointers, recursion)
- T5: patterns (strlen, bsearch, sort, hash, GCD, popcount)
Build infrastructure:
- build.sh: gcc/clang x {O0..Os} x {x86_64, i386, aarch64, armhf}
- GitHub Actions workflow to build with MSVC on Windows
Includes 50 pre-built x86_64 ELF binaries (gcc + clang, O0-Os).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use matrix.outdir and env vars instead of CMD if-else for path selection. Merge cleanup into build step. Fixes delayed-expansion issue in the separate cleanup step. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/{x86_64,i386}/ccop_triggers/tests_src/ccop_triggers/Companion PR: angr/angr#6111
🤖 Generated with Claude Code