printf test: loop with divergent exit condition

Change-Id: I1071e4a240a280332bde669701c72228b9dea2df


[ROCm/hip commit: 1d464f391e]
This commit is contained in:
Sameer Sahasrabuddhe
2020-04-09 10:20:11 +05:30
parent c34599e77c
commit df03380378
2 changed files with 41 additions and 0 deletions
+4
View File
@@ -55,11 +55,15 @@ THE SOFTWARE.
printf("%sPASSED!%s\n", KGRN, KNRM); \
exit(0);
// The real "assert" would have written to stderr. But it is
// sufficient to just fflush here without getting pedantic. This also
// ensures that we don't lose any earlier writes to stdout.
#define failed(...) \
printf("%serror: ", KRED); \
printf(__VA_ARGS__); \
printf("\n"); \
printf("error: TEST FAILED\n%s", KNRM); \
fflush(nullptr); \
abort();
#define warn(...) \