diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 133ee36..bed9b95 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: runs-on: macos-latest strategy: matrix: - llvm: [14, 15, 16, 17, 18, 19] + llvm: [14, 15, 16, 17, 18, 19, 20] steps: - name: Checkout uses: actions/checkout@v4 @@ -18,23 +18,24 @@ jobs: uses: actions/setup-go@v5 with: go-version: '1.22' - #- name: Update Homebrew - # if: matrix.llvm == 17 # needed as long as LLVM 17 is still fresh - # run: brew update + # Optional step when a LLVM version is very new. + - name: Update Homebrew + if: matrix.llvm == 20 + run: brew update - name: Install LLVM run: HOMEBREW_NO_AUTO_UPDATE=1 brew install llvm@${{ matrix.llvm }} - name: Test LLVM ${{ matrix.llvm }} run: go test -v -tags=llvm${{ matrix.llvm }} - name: Test default LLVM - if: matrix.llvm == 19 + if: matrix.llvm == 20 run: go test -v test-linux: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: - llvm: [14, 15, 16, 17, 18, 19] + llvm: [14, 15, 16, 17, 18, 19, 20] steps: - name: Checkout uses: actions/checkout@v4 @@ -44,7 +45,7 @@ jobs: go-version: '1.22' - name: Install LLVM run: | - echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${{ matrix.llvm }} main' | sudo tee /etc/apt/sources.list.d/llvm.list + echo 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{ matrix.llvm }} main' | sudo tee /etc/apt/sources.list.d/llvm.list wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - sudo apt-get update sudo apt-get install --no-install-recommends llvm-${{ matrix.llvm }}-dev @@ -52,6 +53,6 @@ jobs: run: go test -v -tags=llvm${{ matrix.llvm }} - name: Test default LLVM - if: matrix.llvm == 19 + if: matrix.llvm == 20 run: go test -v diff --git a/README.markdown b/README.markdown index 2e93808..efd2ecb 100644 --- a/README.markdown +++ b/README.markdown @@ -4,10 +4,9 @@ This library provides bindings to a system-installed LLVM. Currently supported: - * LLVM 19, 18, 17, 16, 15 and 14 from [apt.llvm.org](http://apt.llvm.org/) on Debian/Ubuntu. - * LLVM 19, 18, 17, 16, 15 and 14 from Homebrew on macOS. - * LLVM 19 with a manually built LLVM through the `byollvm` build tag. You - need to set up `CFLAGS`/`LDFLAGS` etc yourself in this case. + * LLVM 20, 19, 18, 17, 16, 15 and 14 from [apt.llvm.org](http://apt.llvm.org/) on Debian/Ubuntu. + * LLVM 20, 19, 18, 17, 16, 15 and 14 from Homebrew on macOS. + * Any of the above versions with a manually built LLVM through the `byollvm` build tag. You need to set up `CFLAGS`/`LDFLAGS` etc yourself in this case. You can select the LLVM version using a build tag, for example `-tags=llvm17` to use LLVM 17. diff --git a/llvm_config_darwin_llvm19.go b/llvm_config_darwin_llvm19.go index fbf6c4a..eae7744 100644 --- a/llvm_config_darwin_llvm19.go +++ b/llvm_config_darwin_llvm19.go @@ -1,4 +1,4 @@ -//go:build !byollvm && darwin && !llvm14 && !llvm15 && !llvm16 && !llvm17 && !llvm18 +//go:build !byollvm && darwin && llvm19 package llvm diff --git a/llvm_config_darwin_llvm20.go b/llvm_config_darwin_llvm20.go new file mode 100644 index 0000000..22d2826 --- /dev/null +++ b/llvm_config_darwin_llvm20.go @@ -0,0 +1,15 @@ +//go:build !byollvm && darwin && !llvm14 && !llvm15 && !llvm16 && !llvm17 && !llvm18 && !llvm19 + +package llvm + +// Automatically generated by `make config BUILDDIR=`, do not edit. + +// #cgo amd64 CPPFLAGS: -I/usr/local/opt/llvm@20/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS +// #cgo amd64 CXXFLAGS: -std=c++17 +// #cgo amd64 LDFLAGS: -L/usr/local/opt/llvm@20/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names -lLLVM -lz -lm +// #cgo arm64 CPPFLAGS: -I/opt/homebrew/opt/llvm@20/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS +// #cgo arm64 CXXFLAGS: -std=c++17 +// #cgo arm64 LDFLAGS: -L/opt/homebrew/opt/llvm@20/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names -lLLVM -lz -lm +import "C" + +type run_build_sh int diff --git a/llvm_config_linux_llvm19.go b/llvm_config_linux_llvm19.go index 5b36685..ec7c36a 100644 --- a/llvm_config_linux_llvm19.go +++ b/llvm_config_linux_llvm19.go @@ -1,4 +1,4 @@ -//go:build !byollvm && linux && !llvm14 && !llvm15 && !llvm16 && !llvm17 && !llvm18 +//go:build !byollvm && linux && llvm19 package llvm diff --git a/llvm_config_linux_llvm20.go b/llvm_config_linux_llvm20.go new file mode 100644 index 0000000..a610933 --- /dev/null +++ b/llvm_config_linux_llvm20.go @@ -0,0 +1,10 @@ +//go:build !byollvm && linux && !llvm14 && !llvm15 && !llvm16 && !llvm17 && !llvm18 && !llvm19 + +package llvm + +// #cgo CPPFLAGS: -I/usr/include/llvm-20 -I/usr/include/llvm-c-20 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS +// #cgo CXXFLAGS: -std=c++17 +// #cgo LDFLAGS: -L/usr/lib/llvm-20/lib -lLLVM-20 +import "C" + +type run_build_sh int diff --git a/string_test.go b/string_test.go deleted file mode 100644 index 56cbc9f..0000000 --- a/string_test.go +++ /dev/null @@ -1,27 +0,0 @@ -//===- string_test.go - test Stringer implementation for Type -------------===// -// -// 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 file tests the Stringer interface for the Type type. -// -//===----------------------------------------------------------------------===// - -package llvm - -import ( - "testing" -) - -func TestStringRecursiveType(t *testing.T) { - ctx := NewContext() - defer ctx.Dispose() - s := ctx.StructCreateNamed("recursive") - s.StructSetBody([]Type{s, s}, false) - if str := s.String(); str != "%recursive: StructType(%recursive, %recursive)" { - t.Errorf("incorrect string result %q", str) - } -}