1#include "shared.rsh" 2 3int *ain; 4int *aout; 5int dimX; 6static bool failed = false; 7 8void init_vars(int *out) { 9 *out = 7; 10} 11 12 13int __attribute__((kernel)) root(int ain, uint32_t x) { 14 _RS_ASSERT(ain == 7); 15 return ain + x; 16} 17 18static bool test_root_output() { 19 bool failed = false; 20 int i; 21 22 for (i = 0; i < dimX; i++) { 23 _RS_ASSERT(aout[i] == (i + ain[i])); 24 } 25 26 if (failed) { 27 rsDebug("test_root_output FAILED", 0); 28 } 29 else { 30 rsDebug("test_root_output PASSED", 0); 31 } 32 33 return failed; 34} 35 36void verify_root() { 37 failed |= test_root_output(); 38} 39 40void kernel_test() { 41 if (failed) { 42 rsSendToClientBlocking(RS_MSG_TEST_FAILED); 43 } 44 else { 45 rsSendToClientBlocking(RS_MSG_TEST_PASSED); 46 } 47} 48