llvm-project/llvm/test/tools/llvm-reduce/reduce-instructions-token.ll
Matt Arsenault f4cb935ce8 llvm-reduce: Fix invalid reductions for exceptions, tokens and swifterror
Copies the same special cases that bugpoint uses. Technically the
token condition is stricter than what the verifier enforces.

Part 1 of #58815
2023-01-03 17:03:20 -05:00

22 lines
798 B
LLVM

; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=instructions --test FileCheck --test-arg --check-prefixes=CHECK,INTERESTING --test-arg %s --test-arg --input-file %s -o %t
; RUN: FileCheck -check-prefixes=CHECK,RESULT %s < %t
; CHECK-LABEL: define void @tokens(
; INTERESTING: store i32 0
; INTERESTING: call void @llvm.token.consumer
; RESULT: %token = call token @llvm.token.producer()
; RESULT-NEXT: store i32 0, ptr %ptr, align 4
; RESULT-NEXT: call void @llvm.token.consumer(token %token)
; RESULT-NEXT: ret void
define void @tokens(ptr %ptr) {
%token = call token @llvm.token.producer()
store i32 0, ptr %ptr
call void @llvm.token.consumer(token %token)
store i32 1, ptr %ptr
ret void
}
declare token @llvm.token.producer()
declare void @llvm.token.consumer(token)