Lines Matching refs:test_cpp_expr_optim

1014 def test_cpp_expr_optim(expr, expected, macros={}):  function
1046 test_cpp_expr_optim("0", "(int 0)")
1047 test_cpp_expr_optim("1", "(int 1)")
1048 test_cpp_expr_optim("1 && 1", "(int 1)")
1049 test_cpp_expr_optim("1 && 0", "(int 0)")
1050 test_cpp_expr_optim("0 && 1", "(int 0)")
1051 test_cpp_expr_optim("0 && 0", "(int 0)")
1052 test_cpp_expr_optim("1 || 1", "(int 1)")
1053 test_cpp_expr_optim("1 || 0", "(int 1)")
1054 test_cpp_expr_optim("0 || 1", "(int 1)")
1055 test_cpp_expr_optim("0 || 0", "(int 0)")
1056 test_cpp_expr_optim("A", "(ident A)")
1057 test_cpp_expr_optim("A", "(int 1)", { "A": 1 })
1058 test_cpp_expr_optim("A || B", "(int 1)", { "A": 1 })
1059 test_cpp_expr_optim("A || B", "(int 1)", { "B": 1 })
1060 test_cpp_expr_optim("A && B", "(ident B)", { "A": 1 })
1061 test_cpp_expr_optim("A && B", "(ident A)", { "B": 1 })
1062 test_cpp_expr_optim("A && B", "(&& (ident A) (ident B))")
1063 test_cpp_expr_optim("EXAMPLE", "(ident EXAMPLE)")
1064 test_cpp_expr_optim("EXAMPLE - 3", "(- (ident EXAMPLE) (int 3))")
1065 test_cpp_expr_optim("defined(EXAMPLE)", "(defined EXAMPLE)")
1066 test_cpp_expr_optim("defined(EXAMPLE)", "(defined XOWOE)", { "EXAMPLE": "XOWOE" })
1067 test_cpp_expr_optim("defined(EXAMPLE)", "(int 0)", { "EXAMPLE": kCppUndefinedMacro})
1068 test_cpp_expr_optim("!defined(EXAMPLE)", "(! (defined EXAMPLE))")
1069 test_cpp_expr_optim("!defined(EXAMPLE)", "(! (defined XOWOE))", { "EXAMPLE" : "XOWOE" })
1070 test_cpp_expr_optim("!defined(EXAMPLE)", "(int 1)", { "EXAMPLE" : kCppUndefinedMacro })
1071 test_cpp_expr_optim("defined(A) || defined(B)", "(|| (defined A) (defined B))")
1072 test_cpp_expr_optim("defined(A) || defined(B)", "(int 1)", { "A" : "1" })
1073 test_cpp_expr_optim("defined(A) || defined(B)", "(int 1)", { "B" : "1" })
1074 test_cpp_expr_optim("defined(A) || defined(B)", "(defined A)", { "B" : kCppUndefinedMacro })
1075test_cpp_expr_optim("defined(A) || defined(B)", "(int 0)", { "A" : kCppUndefinedMacro, "B" : kCppU…
1076 test_cpp_expr_optim("defined(A) && defined(B)", "(&& (defined A) (defined B))")
1077 test_cpp_expr_optim("defined(A) && defined(B)", "(defined B)", { "A" : "1" })
1078 test_cpp_expr_optim("defined(A) && defined(B)", "(defined A)", { "B" : "1" })
1079 test_cpp_expr_optim("defined(A) && defined(B)", "(int 0)", { "B" : kCppUndefinedMacro })
1080 test_cpp_expr_optim("defined(A) && defined(B)", "(int 0)", { "A" : kCppUndefinedMacro })
1081 test_cpp_expr_optim("A == 1 || defined(B)", "(|| (== (ident A) (int 1)) (defined B))" )
1082test_cpp_expr_optim("defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)", "(|| (! (defi…