• Home
  • Raw
  • Download

Lines Matching refs:test_cpp_expr_optim

842 def test_cpp_expr_optim(expr, expected, macros=None):  function
888 test_cpp_expr_optim("0", "(int 0)")
889 test_cpp_expr_optim("1", "(int 1)")
890 test_cpp_expr_optim("1 && 1", "(int 1)")
891 test_cpp_expr_optim("1 && +1", "(int 1)")
892 test_cpp_expr_optim("0x1 && 01", "(oct 01)")
893 test_cpp_expr_optim("1 && 0", "(int 0)")
894 test_cpp_expr_optim("0 && 1", "(int 0)")
895 test_cpp_expr_optim("0 && 0", "(int 0)")
896 test_cpp_expr_optim("1 || 1", "(int 1)")
897 test_cpp_expr_optim("1 || 0", "(int 1)")
898 test_cpp_expr_optim("0 || 1", "(int 1)")
899 test_cpp_expr_optim("0 || 0", "(int 0)")
900 test_cpp_expr_optim("A", "(ident A)")
901 test_cpp_expr_optim("A", "(int 1)", {"A": 1})
902 test_cpp_expr_optim("A || B", "(int 1)", {"A": 1})
903 test_cpp_expr_optim("A || B", "(int 1)", {"B": 1})
904 test_cpp_expr_optim("A && B", "(ident B)", {"A": 1})
905 test_cpp_expr_optim("A && B", "(ident A)", {"B": 1})
906 test_cpp_expr_optim("A && B", "(&& (ident A) (ident B))")
907 test_cpp_expr_optim("EXAMPLE", "(ident EXAMPLE)")
908 test_cpp_expr_optim("EXAMPLE - 3", "(- (ident EXAMPLE) (int 3))")
909 test_cpp_expr_optim("defined(EXAMPLE)", "(defined EXAMPLE)")
910 test_cpp_expr_optim("defined(EXAMPLE)", "(defined XOWOE)",
912 test_cpp_expr_optim("defined(EXAMPLE)", "(int 0)",
914 test_cpp_expr_optim("!defined(EXAMPLE)", "(! (defined EXAMPLE))")
915 test_cpp_expr_optim("!defined(EXAMPLE)", "(! (defined XOWOE))",
917 test_cpp_expr_optim("!defined(EXAMPLE)", "(int 1)",
919 test_cpp_expr_optim("defined(A) || defined(B)",
921 test_cpp_expr_optim("defined(A) || defined(B)", "(int 1)", {"A": "1"})
922 test_cpp_expr_optim("defined(A) || defined(B)", "(int 1)", {"B": "1"})
923 test_cpp_expr_optim("defined(A) || defined(B)", "(defined A)",
925 test_cpp_expr_optim("defined(A) || defined(B)", "(int 0)",
927 test_cpp_expr_optim("defined(A) && defined(B)",
929 test_cpp_expr_optim("defined(A) && defined(B)",
931 test_cpp_expr_optim("defined(A) && defined(B)",
933 test_cpp_expr_optim("defined(A) && defined(B)", "(int 0)",
935 test_cpp_expr_optim("defined(A) && defined(B)",
937 test_cpp_expr_optim("A == 1 || defined(B)",
939 test_cpp_expr_optim(