test-error-unrecognized-dump.c 539 B

12345678910111213141516171819202122232425262728
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include "libgccjit.h"
  4. #include "harness.h"
  5. static char *dump;
  6. void
  7. create_code (gcc_jit_context *ctxt, void *user_data)
  8. {
  9. gcc_jit_context_enable_dump (ctxt,
  10. "not-a-valid-dump-switch",
  11. &dump);
  12. }
  13. void
  14. verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
  15. {
  16. CHECK_VALUE (result, NULL);
  17. /* Verify that the correct error message was emitted. */
  18. CHECK_STRING_VALUE (gcc_jit_context_get_first_error (ctxt),
  19. "unrecognized dump: not-a-valid-dump-switch");
  20. }