diff --git a/.github/workflows/macos-12.yml b/.github/workflows/macos-12.yml deleted file mode 100644 index b29b9ed..0000000 --- a/.github/workflows/macos-12.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: macOS 12 - -on: - pull_request: - push: - branches: - - main - -jobs: - test: - name: LLVM ${{ matrix.LLVM_VERSION }} - runs-on: macos-12 - strategy: - matrix: - LLVM_VERSION: [12.0.0, 13.0.0, 14.0.0, 15.0.0] - - steps: - - uses: actions/checkout@v1 - with: - submodules: true - - name: Setup OS - run: | - brew install gnu-tar - sudo ln -s /usr/local/bin/gtar /usr/local/bin/tar - pip3 install ansible - - name: Prepare working directory - run: | - sudo mkdir -p /opt - sudo chown -R `whoami` /opt - - name: Download LLVM - run: | - cd ci && \ - ansible-playbook download-llvm.yaml \ - -e llvm_version=${{ matrix.LLVM_VERSION }} \ - -e platform=macOS-12 \ - -e host=localhost \ - --verbose - - name: Build and run tests - run: | - cd ci && \ - ansible-playbook build.yaml \ - -e llvm_version=${{ matrix.LLVM_VERSION }} \ - -e platform=macOS-12 \ - -e host=localhost \ - -e source_dir=$PWD/.. \ - --verbose diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..4c1a1f5 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,38 @@ +name: macOS + +on: + pull_request: + push: + branches: + - main + +jobs: + test: + name: LLVM ${{ matrix.LLVM_VERSION }} + runs-on: macos-latest + strategy: + matrix: + LLVM_VERSION: [18, 19] + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Install LLVM + run: brew install llvm@${{ matrix.LLVM_VERSION }} + + - name: Build and test (Debug) + run: | + cmake -B build-debug -G Ninja \ + -DPATH_TO_LLVM=$(brew --prefix llvm@${{ matrix.LLVM_VERSION }}) + cmake --build build-debug --target irm-tests + ./build-debug/tests/irm-tests + + - name: Build and test (Release) + run: | + cmake -B build-release -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DPATH_TO_LLVM=$(brew --prefix llvm@${{ matrix.LLVM_VERSION }}) + cmake --build build-release --target irm-tests + ./build-release/tests/irm-tests diff --git a/.github/workflows/ubuntu-18.04.yml b/.github/workflows/ubuntu-18.04.yml deleted file mode 100644 index 043d94c..0000000 --- a/.github/workflows/ubuntu-18.04.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: CI Ubuntu 18.04 - -on: - pull_request: - push: - branches: - - main - -jobs: - test: - name: LLVM ${{ matrix.LLVM_VERSION }} - runs-on: ubuntu-20.04 - container: ubuntu:18.04 - strategy: - matrix: - LLVM_VERSION: [14.0.0] - - steps: - - name: Install software - run: | - apt-get update && apt-get install -y software-properties-common - add-apt-repository ppa:git-core/ppa - apt-get update && apt-get install -y python-pip curl git cmake \ - libz-dev ncurses-dev libstdc++6 liblzma-dev - pip install ansible - - uses: actions/checkout@v1 - with: - submodules: true - - name: Prepare working directory - run: | - mkdir -p /opt - - name: Download LLVM - run: | - cd ci && \ - ansible-playbook download-llvm.yaml \ - -e llvm_version=${{ matrix.LLVM_VERSION }} \ - -e platform=ubuntu-18.04 \ - -e host=localhost \ - --verbose - - name: Build and run tests - run: | - cd ci && \ - ansible-playbook build.yaml \ - -e llvm_version=${{ matrix.LLVM_VERSION }} \ - -e platform=ubuntu-18.04 \ - -e host=localhost \ - -e source_dir=$PWD/.. \ - --verbose diff --git a/.github/workflows/ubuntu-20.04.yaml b/.github/workflows/ubuntu-20.04.yaml deleted file mode 100644 index 18c49c7..0000000 --- a/.github/workflows/ubuntu-20.04.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: CI Ubuntu 20.04 - -on: - pull_request: - push: - branches: - - main - -jobs: - test: - name: LLVM ${{ matrix.LLVM_VERSION }} - runs-on: ubuntu-20.04 - container: ubuntu:20.04 - strategy: - matrix: - LLVM_VERSION: [12.0.0, 13.0.0, 14.0.0] - - steps: - - name: Install software - run: env - - - name: Install software - run: | - apt-get update && apt-get install -y software-properties-common - add-apt-repository ppa:git-core/ppa - apt-get update && apt-get install -y python3-pip curl git cmake \ - libz-dev ncurses-dev libstdc++6 liblzma-dev - pip3 install ansible - - uses: actions/checkout@v1 - with: - submodules: true - - name: Prepare working directory - run: | - mkdir -p /opt - - name: Download LLVM - run: | - cd ci && \ - ansible-playbook download-llvm.yaml \ - -e llvm_version=${{ matrix.LLVM_VERSION }} \ - -e platform=ubuntu-20.04 \ - -e host=localhost \ - --verbose - - name: Build and run tests - run: | - cd ci && \ - ansible-playbook build.yaml \ - -e llvm_version=${{ matrix.LLVM_VERSION }} \ - -e platform=ubuntu-20.04 \ - -e host=localhost \ - -e source_dir=$PWD/.. \ - --verbose diff --git a/.github/workflows/ubuntu-24.yml b/.github/workflows/ubuntu-24.yml new file mode 100644 index 0000000..ea5f111 --- /dev/null +++ b/.github/workflows/ubuntu-24.yml @@ -0,0 +1,44 @@ +name: Ubuntu 24.04 + +on: + pull_request: + push: + branches: + - main + +jobs: + test: + name: LLVM ${{ matrix.LLVM_VERSION }} + runs-on: ubuntu-24.04 + strategy: + matrix: + LLVM_VERSION: [18, 19] + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Install LLVM + run: sudo apt-get update && sudo apt-get install -y ninja-build llvm-${{ matrix.LLVM_VERSION }}-dev clang-${{ matrix.LLVM_VERSION }} + + - name: Build and test (Debug) + env: + CC: clang-${{ matrix.LLVM_VERSION }} + CXX: clang++-${{ matrix.LLVM_VERSION }} + run: | + cmake -B build-debug -G Ninja \ + -DPATH_TO_LLVM=/usr/lib/llvm-${{ matrix.LLVM_VERSION }} + cmake --build build-debug --target irm-tests + ./build-debug/tests/irm-tests + + - name: Build and test (Release) + env: + CC: clang-${{ matrix.LLVM_VERSION }} + CXX: clang++-${{ matrix.LLVM_VERSION }} + run: | + cmake -B build-release -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DPATH_TO_LLVM=/usr/lib/llvm-${{ matrix.LLVM_VERSION }} + cmake --build build-release --target irm-tests + ./build-release/tests/irm-tests diff --git a/ci/ansible.cfg b/ci/ansible.cfg deleted file mode 100644 index 6be61be..0000000 --- a/ci/ansible.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[defaults] -# Use the YAML callback plugin. -stdout_callback = yaml -# Use the stdout_callback when running ad-hoc commands. -bin_ansible_callbacks = True diff --git a/ci/build.yaml b/ci/build.yaml deleted file mode 100644 index ea894aa..0000000 --- a/ci/build.yaml +++ /dev/null @@ -1,54 +0,0 @@ -- name: Build libirm and run tests - hosts: "localhost" - - vars_files: - - variables.yaml - - tasks: - - name: Create Build Directory (Debug) - file: - path: "{{ debug_build_dir }}" - state: directory - - - name: Prepare Build System (Debug) - command: cmake -DPATH_TO_LLVM={{ llvm_dir }} -DCMAKE_CXX_FLAGS="{{ cxx_flags }}" {{ source_dir }} - args: - chdir: "{{ debug_build_dir }}" - creates: "{{ debug_build_dir }}/CMakeCache.txt" - environment: - CC: "{{ llvm_dir }}/bin/clang" - CXX: "{{ llvm_dir }}/bin/clang++" - - - name: Build libirm (Debug) - command: make all irm-tests -j {{ ansible_processor_vcpus }} - args: - chdir: "{{ debug_build_dir }}" - - - name: Run Tests (Debug) - command: "tests/irm-tests" - args: - chdir: "{{ debug_build_dir }}" - - - name: Create Build Directory (Release) - file: - path: "{{ release_build_dir }}" - state: directory - - - name: Prepare Build System (Release) - command: cmake -DPATH_TO_LLVM={{ llvm_dir }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="{{ cxx_flags }}" {{ source_dir }} - args: - chdir: "{{ release_build_dir }}" - creates: "{{ release_build_dir }}/CMakeCache.txt" - environment: - CC: "{{ llvm_dir }}/bin/clang" - CXX: "{{ llvm_dir }}/bin/clang++" - - - name: Build libirm (Release) - command: make all irm-tests -j {{ ansible_processor_vcpus }} - args: - chdir: "{{ release_build_dir }}" - - - name: Run Tests (Release) - command: "{{ release_build_dir}}/tests/irm-tests" - args: - chdir: "{{ release_build_dir }}" diff --git a/ci/download-llvm.yaml b/ci/download-llvm.yaml deleted file mode 100644 index eb86c93..0000000 --- a/ci/download-llvm.yaml +++ /dev/null @@ -1,25 +0,0 @@ -- name: Download LLVM - hosts: "localhost" - - vars_files: - - variables.yaml - - tasks: - - name: Download LLVM ({{ llvm_version }}) - get_url: - url: "{{ llvm_url }}" - dest: "{{ working_dir }}/{{ llvm_version }}.tar.gz" - timeout: 30 - register: download_llvm - - - name: Extract LLVM ({{ llvm_version }}) - unarchive: - src: "{{ working_dir }}/{{ llvm_version }}.tar.gz" - dest: "{{ working_dir }}" - remote_src: yes - when: download_llvm.changed - - - name: Move LLVM ({{ llvm_version }}) - command: mv {{ working_dir }}/{{ llvm_path }} {{ llvm_dir }} - args: - creates: "{{ llvm_dir }}" diff --git a/ci/variables.yaml b/ci/variables.yaml deleted file mode 100644 index 97b46ac..0000000 --- a/ci/variables.yaml +++ /dev/null @@ -1,48 +0,0 @@ ---- -working_dir: /opt - -source_dir: "{{ working_dir }}/mull" -debug_build_dir: "{{ working_dir }}/build.mull.debug.dir" -release_build_dir: "{{ working_dir }}/build.mull.release.dir" - -cxx_flags_mapping: - macOS-12: - ubuntu-18.04: -D_GLIBCXX_USE_CXX11_ABI=1 - ubuntu-20.04: -D_GLIBCXX_USE_CXX11_ABI=1 - -llvm_mapping: - macOS-12: - 15.0.0: - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.0/clang+llvm-15.0.0-x86_64-apple-darwin.tar.xz - path: clang+llvm-15.0.0-x86_64-apple-darwin - 14.0.0: - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-apple-darwin.tar.xz - path: clang+llvm-14.0.0-x86_64-apple-darwin - 13.0.0: - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz - path: clang+llvm-13.0.0-x86_64-apple-darwin - 12.0.0: - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-x86_64-apple-darwin.tar.xz - path: clang+llvm-12.0.0-x86_64-apple-darwin - - ubuntu-20.04: - 14.0.0: - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz - path: clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04 - 13.0.0: - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz - path: clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04 - 12.0.0: - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz - path: clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04 - - ubuntu-18.04: - 14.0.0: - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz - path: clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04 - -llvm_url: "{{ llvm_mapping[platform][llvm_version].url }}" -llvm_path: "{{ llvm_mapping[platform][llvm_version].path }}" -llvm_dir: "{{ working_dir }}/llvm-{{ llvm_version }}" - -cxx_flags: "{{ cxx_flags_mapping[platform] }}" diff --git a/tests/Mutations/CallRemovalTests.cpp b/tests/Mutations/CallRemovalTests.cpp index 0d19697..31b58cd 100644 --- a/tests/Mutations/CallRemovalTests.cpp +++ b/tests/Mutations/CallRemovalTests.cpp @@ -16,6 +16,7 @@ #include #include +#include #include using namespace irm; @@ -41,11 +42,16 @@ TEST(CallRemoval, canMutate) { auto voidFunction = llvm::Function::Create( voidFunctionType, llvm::Function::InternalLinkage, "call_void", module); + auto ptrType = llvm::PointerType::get(context, 0); +#if LLVM_VERSION_MAJOR >= 19 + auto intrinsicFunction = llvm::Intrinsic::getDeclaration(&module, llvm::Intrinsic::vastart, {ptrType}); +#else auto intrinsicFunction = llvm::Intrinsic::getDeclaration(&module, llvm::Intrinsic::vastart); +#endif auto callInt = llvm::CallInst::Create(intFunction, {}, "", basicBlock); auto callVoid = llvm::CallInst::Create(voidFunction, {}, "", basicBlock); - auto null = llvm::ConstantPointerNull::get(intType->getPointerTo(0)); + auto null = llvm::ConstantPointerNull::get(ptrType); auto callIntrinsic = llvm::CallInst::Create(intrinsicFunction, { null }, "", basicBlock); MutatorNoIntrinsics mutatorNoIntrinsics;