[clang] [clang][NFC] Split invalid-cpu-note tests (PR #104601)

Tomas Matheson via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 17 02:16:08 PDT 2024


================
@@ -0,0 +1,90 @@
+// Use --implicit-check-not to ensure no additional CPUs are in this list
+
+// RUN: not %clang_cc1 -triple arm64--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --implicit-check-not={{[a-zA-Z0-9]}}
+// RUN: not %clang_cc1 -triple arm64--- -tune-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --implicit-check-not={{[a-zA-Z0-9]}}
+
+// CHECK: error: unknown target CPU 'not-a-cpu'
+// CHECK-NEXT: note: valid target CPU values are:
+// CHECK-SAME: a64fx,
----------------
tmatheson-arm wrote:

Tbh, the `--implicit-check-not` method looks cleaner to me than having `{{^}}` on every line. But it only works because there is so little output for this test to it can all be checked. There might be a case for adding (not in this PR) something like `CHECK-SAME-NEXT:` which would be useful across a large class of tests. The `-target-feature` tests could benefit from this too.

https://github.com/llvm/llvm-project/pull/104601


More information about the cfe-commits mailing list