The code is working properly. You have mixed up your error messages. The code should be:
#if defined(TEST)
#error "DEFINED"
#else
#error "NOT DEFINED"
#endif
The code is working properly. You have mixed up your error messages. The code should be:
#if defined(TEST)
#error "DEFINED"
#else
#error "NOT DEFINED"
#endif