diff --git a/Formula/llvm.rb b/Formula/llvm.rb index 96df38f14a77b..d5935eaa1a055 100644 --- a/Formula/llvm.rb +++ b/Formula/llvm.rb @@ -79,6 +79,7 @@ def install lldb openmp polly + mlir ] runtimes = %w[ compiler-rt @@ -139,9 +140,9 @@ def install llvmpath = buildpath/"llvm" mkdir llvmpath/"build" do system "cmake", "-G", "Unix Makefiles", "..", *(std_cmake_args + args) - system "make" - system "make", "install" - system "make", "install-xcode-toolchain" if MacOS::Xcode.installed? + system "cmake", "--build", "." + system "cmake", "--build", ".", "--target", "install" + system "cmake", "--build", ".", "--target", "install-xcode-toolchain" if MacOS::Xcode.installed? end # Install LLVM Python bindings @@ -209,6 +210,15 @@ def caveats } EOS + # Testing mlir + (testpath/"test.mlir").write <<~EOS + func @bad_branch() { + br ^missing // expected-error {{reference to an undefined block}} + } + EOS + + system "#{bin}/mlir-opt", "--verify-diagnostics", "test.mlir" + # Testing default toolchain and SDK location. system "#{bin}/clang++", "-v", "-std=c++11", "test.cpp", "-o", "test++"