Test for loop with break and continue statements. Python ``break`` / ``continue`` keywords lower to ``T.evaluate(T.break_loop())`` / ``T.evaluate(T.continue_loop())`` (Evaluate + Call) rather than dedicated Break / Continue Stmt nodes.
()
| 883 | |
| 884 | |
| 885 | def test_for_with_break_continue(): |
| 886 | """Test for loop with break and continue statements. |
| 887 | |
| 888 | Python ``break`` / ``continue`` keywords lower to |
| 889 | ``T.evaluate(T.break_loop())`` / ``T.evaluate(T.continue_loop())`` |
| 890 | (Evaluate + Call) rather than dedicated Break / Continue Stmt nodes. |
| 891 | """ |
| 892 | for_with_break = create_test_statements()["for_with_break"] |
| 893 | basic_check( |
| 894 | for_with_break, |
| 895 | "\n".join( |
| 896 | [ |
| 897 | "For", |
| 898 | "\tIntImm", |
| 899 | "\tIntImm", |
| 900 | "\tSeqStmt", |
| 901 | "\t\tBufferStore", |
| 902 | "\t\t\tAdd", |
| 903 | "\t\t\t\tVar", |
| 904 | "\t\t\t\tIntImm", |
| 905 | "\t\t\tVar", |
| 906 | "\t\tIfThenElse", |
| 907 | "\t\t\tEQ", |
| 908 | "\t\t\t\tVar", |
| 909 | "\t\t\t\tIntImm", |
| 910 | "\t\t\tEvaluate", |
| 911 | "\t\t\t\tExpr::Call", |
| 912 | "\t\tEvaluate", |
| 913 | "\t\t\tExpr::Call", |
| 914 | ] |
| 915 | ), |
| 916 | "\n".join( |
| 917 | [ |
| 918 | "IntImm", |
| 919 | "IntImm", |
| 920 | "Var", |
| 921 | "IntImm", |
| 922 | "Add", |
| 923 | "Var", |
| 924 | "BufferStore", |
| 925 | "Var", |
| 926 | "IntImm", |
| 927 | "EQ", |
| 928 | "Expr::Call", |
| 929 | "Evaluate", |
| 930 | "IfThenElse", |
| 931 | "Expr::Call", |
| 932 | "Evaluate", |
| 933 | "SeqStmt", |
| 934 | "For", |
| 935 | ] |
| 936 | ), |
| 937 | ) |
| 938 | |
| 939 | |
| 940 | def test_decl_buffer(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…