|
15 | 15 | // - #include "swift/SIL/Test.h"
|
16 | 16 | // - namespace swift::test {
|
17 | 17 | // static FunctionTest MyNewTest(
|
18 |
| -// "my-new-test", |
| 18 | +// "my_new_test", |
19 | 19 | // [](auto &function, auto &arguments, auto &test) {
|
20 | 20 | // });
|
21 | 21 | // } // end namespace swift::test
|
|
43 | 43 | // and
|
44 | 44 | //
|
45 | 45 | // static FunctionTest MyNeatoUtilityTest(
|
46 |
| -// "my-neato-utility", |
47 |
| -// [](auto *test, auto *function, auto &arguments) { |
| 46 | +// "my_neato_utility", |
| 47 | +// [](auto &function, auto &arguments, auto &test) { |
48 | 48 | // // The code here is described in detail below.
|
49 | 49 | // // See 4).
|
50 | 50 | // auto count = arguments.takeUInt();
|
|
53 | 53 | // // See 5)
|
54 | 54 | // myNeatoUtility(count, target, callee);
|
55 | 55 | // // See 6)
|
56 |
| -// getFunction()->dump(); |
| 56 | +// function.dump(); |
57 | 57 | // });
|
58 | 58 | // 1) A test test/SILOptimizer/interesting_functionality_unit.sil runs the
|
59 | 59 | // TestRunner pass:
|
|
62 | 62 | // specify_test instruction.
|
63 | 63 | // sil @f : $() -> () {
|
64 | 64 | // ...
|
65 |
| -// specify_test "my-neato-utility 43 @trace[2] @function[other_fun]" |
| 65 | +// specify_test "my_neato_utility 43 %2 @function[other_fun]" |
66 | 66 | // ...
|
67 | 67 | // }
|
68 | 68 | // 3) TestRunner finds the FunctionTest instance MyNeatoUtilityTest registered
|
69 |
| -// under the name "my-neato-utility", and calls ::run() on it, passing an |
70 |
| -// the pass, the function AND most importantly an test::Arguments instance |
71 |
| -// that contains |
| 69 | +// under the name "my_neato_utility", and calls ::run() on it, passing first |
| 70 | +// the function, last the test::FunctionTest instance, AND in the middle, |
| 71 | +// most importantly a test::Arguments instance that contains |
| 72 | +// |
72 | 73 | // (43 : unsigned long, someValue : SILValue, other_fun : SILFunction *)
|
73 | 74 | //
|
74 | 75 | // 4) MyNeatoUtilityTest calls takeUInt(), takeValue(), and takeFunction() on
|
|
84 | 85 | // myNeatoUtility(count, target, callee);
|
85 | 86 | // 6) MyNeatoUtilityTest then dumps out the current function, which was modified
|
86 | 87 | // in the process.
|
87 |
| -// getFunction()->dump(); |
| 88 | +// function.dump() |
88 | 89 | // 7) The test file test/SILOptimizer/interesting_functionality_unit.sil matches
|
89 | 90 | // the
|
90 | 91 | // expected contents of the modified function:
|
|
0 commit comments