@@ -272,14 +272,21 @@ With those two things in hand, running `creduce` looks like this:
272
272
273
273
### Isolating Your Test Case
274
274
275
- Use the ` -save-temps ` flag to make Clang spit out its intermediate
276
- representations when compiling the test case into an object file .
275
+ If you're using ` bindgen ` as a command line tool, pass
276
+ ` --dump-preprocessed-input ` flag .
277
277
278
- $ clang[++ -x c++ --std=c++14] -save-temps -c my_test_case.h
278
+ If you're using ` bindgen ` as a Rust library, invoke the
279
+ ` bindgen::Builder::dump_preprocessed_input ` method where you call
280
+ ` bindgen::Builder::generate ` .
279
281
280
- There should now be a ` my_test_case.ii ` file, which is the results after the C
281
- pre-processor has processed all the ` #include ` s, ` #define ` s, and ` #ifdef ` s. This
282
- is generally what we're looking for.
282
+ Afterwards, there should be a ` __bindgen.i ` or ` __bindgen.ii ` file containing
283
+ the combined and preprocessed input headers, which is usable as an isolated,
284
+ standalone test case.
285
+
286
+ Note that the preprocessor likely removed all comments, so if the bug you're
287
+ trying to pin down involves source annotations (for example, `/** <div
288
+ rustbindgen opaque> * /`), then you will have to manually reapply them to the
289
+ preprocessed file.
283
290
284
291
### Writing a Predicate Script
285
292
0 commit comments