llvm-project/llvm/test/Feature/codegen-plugin.ll
Alexis Engelke cd806d7e76
[LLVM] Add plugin hook for back-ends
Add a mechanism to permit plugins running code between optimizations and
the back-end passes. Implement this through the LLVM plug-in mechanism
to make permit plugins to be written independently of the front-end.

The primary motivation for this point is TPDE-LLVM, which substitutes
the LLVM back-end (optionally falling back to it for unsupported IR). We
have been distributing a Clang patch; but requiring a custom-build
toolchain is impracticable for many users.

Front-end adjustments will follow as separate patches.

Pull Request: https://github.com/llvm/llvm-project/pull/170846
2025-12-16 16:33:39 +01:00

19 lines
642 B
LLVM

; REQUIRES: x86-registered-target
; RUN: llc < %s %loadnewpmbye | FileCheck %s --check-prefix=CHECK-ASM
; RUN: llc < %s %loadnewpmbye -last-words | FileCheck %s --check-prefix=CHECK-ACTIVE
; RUN: not llc %s %loadnewpmbye -last-words -filetype=obj 2>&1 | FileCheck %s --check-prefix=CHECK-ERR
; REQUIRES: plugins, examples
; UNSUPPORTED: target={{.*windows.*}}
; CHECK-ASM: somefunk:
; CHECK-ACTIVE: CodeGen Bye
; CHECK-ERR: error: last words unsupported for binary output
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@junk = global i32 0
define ptr @somefunk() {
ret ptr @junk
}