| 38 | static void run_pass(migraphx::program& p) { run_pass(*p.get_main_module()); } |
| 39 | |
| 40 | TEST_CASE(simple_test) |
| 41 | { |
| 42 | migraphx::program p; |
| 43 | |
| 44 | auto* mm = p.get_main_module(); |
| 45 | |
| 46 | auto one = mm->add_literal(1); |
| 47 | auto one_identity = mm->add_instruction(migraphx::make_op("identity"), one); |
| 48 | auto two = mm->add_literal(2); |
| 49 | auto two_identity = mm->add_instruction(migraphx::make_op("identity"), two); |
| 50 | mm->add_instruction(migraphx::make_op("add"), one_identity, two_identity); |
| 51 | run_pass(p); |
| 52 | EXPECT(std::none_of(mm->begin(), mm->end(), [](const migraphx::instruction& ins) { |
| 53 | return ins.name() == "identity"; |
| 54 | })); |
| 55 | auto result = p.eval({}).back(); |
| 56 | EXPECT(result == migraphx::literal{3}); |
| 57 | } |
| 58 | |
| 59 | TEST_CASE(simple_test_end) |
| 60 | { |
nothing calls this directly
no test coverage detected