def test_ClangPreprocess_user_directives(): """Test inlining of user-defined preprocessor directives.""" assert opencl.ClangPreprocess(""" #define MY_TYPE int kernel void A(global MY_TYPE* a) {} #ifdef SOME_CONDITIONAL_THING kernel void B() {} #endif """) == """
def test_ClangPreprocess_undefined_macro(): """Test that code with undefined macro is unchanged.""" assert ( opencl.ClangPreprocess( """ kernel void A(global FLOAT_T* a) {} """ ) == """ kernel void A(global FLOAT_T* a) {} """ )
def test_ClangPreprocess_small_program(): """Test that a small program without preprocessor directives is unchanged.""" assert ( opencl.ClangPreprocess( """ kernel void A(global int*a ) {} """ ) == """ kernel void A(global int*a ) {} """ )