Output all diagnostics from tint executable

Otherwise warnings are not emitted unless there is also an error.

Change-Id: If417f75fbdd246b1f792a0f63b83274c8f2272e3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/47481
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
diff --git a/samples/main.cc b/samples/main.cc
index 2f9f7b8..17acb9a 100644
--- a/samples/main.cc
+++ b/samples/main.cc
@@ -659,8 +659,10 @@
               << options.input_filename << std::endl;
     return 1;
   }
-  if (!program->IsValid()) {
+  if (program->Diagnostics().count() > 0) {
     diag_formatter.format(program->Diagnostics(), diag_printer.get());
+  }
+  if (!program->IsValid()) {
     return 1;
   }