[libcxx-commits] [libcxx] [libc++] Add a utility for checking the output of commands (PR #65917)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Dec 20 12:42:29 PST 2024


================
@@ -0,0 +1,22 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// This test is checking the LLVM IR
+// REQUIRES: clang
+
+// RUN: %{cxx} %s %{compile_flags} -O3 -c -S -emit-llvm -o - | %{check-output}
+
+#include <utility>
+
+[[noreturn]] void test() {
+  // CHECK:      define dso_local void
+  // CHECK-SAME: test
+  // CHECK-NEXT: unreachable
+  // CHECK-NEXT: }
+  std::unreachable();
----------------
ldionne wrote:

What is the benefit of this one?

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


More information about the libcxx-commits mailing list