mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
236b71fc75
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140558 91177308-0d34-0410-b5e6-96231b3b80d8
37 lines
717 B
LLVM
37 lines
717 B
LLVM
; RUN: opt < %s -loweratomic -S | FileCheck %s
|
|
|
|
define i8 @add() {
|
|
; CHECK: @add
|
|
%i = alloca i8
|
|
%j = atomicrmw add i8* %i, i8 42 monotonic
|
|
; CHECK: [[INST:%[a-z0-9]+]] = load
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: store
|
|
ret i8 %j
|
|
; CHECK: ret i8 [[INST]]
|
|
}
|
|
|
|
define i8 @nand() {
|
|
; CHECK: @nand
|
|
%i = alloca i8
|
|
%j = atomicrmw nand i8* %i, i8 42 monotonic
|
|
; CHECK: [[INST:%[a-z0-9]+]] = load
|
|
; CHECK-NEXT: and
|
|
; CHECK-NEXT: xor
|
|
; CHECK-NEXT: store
|
|
ret i8 %j
|
|
; CHECK: ret i8 [[INST]]
|
|
}
|
|
|
|
define i8 @min() {
|
|
; CHECK: @min
|
|
%i = alloca i8
|
|
%j = atomicrmw min i8* %i, i8 42 monotonic
|
|
; CHECK: [[INST:%[a-z0-9]+]] = load
|
|
; CHECK-NEXT: icmp
|
|
; CHECK-NEXT: select
|
|
; CHECK-NEXT: store
|
|
ret i8 %j
|
|
; CHECK: ret i8 [[INST]]
|
|
}
|