2010-08-03 16:19:16 +00:00
|
|
|
; RUN: opt < %s -loweratomic -S | FileCheck %s
|
|
|
|
|
|
|
|
define i8 @add() {
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @add(
|
2010-08-03 16:19:16 +00:00
|
|
|
%i = alloca i8
|
2011-09-26 20:15:56 +00:00
|
|
|
%j = atomicrmw add i8* %i, i8 42 monotonic
|
2010-08-03 16:19:16 +00:00
|
|
|
; CHECK: [[INST:%[a-z0-9]+]] = load
|
|
|
|
; CHECK-NEXT: add
|
|
|
|
; CHECK-NEXT: store
|
|
|
|
ret i8 %j
|
|
|
|
; CHECK: ret i8 [[INST]]
|
|
|
|
}
|
|
|
|
|
|
|
|
define i8 @nand() {
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @nand(
|
2010-08-03 16:19:16 +00:00
|
|
|
%i = alloca i8
|
2011-09-26 20:15:56 +00:00
|
|
|
%j = atomicrmw nand i8* %i, i8 42 monotonic
|
2010-08-03 16:19:16 +00:00
|
|
|
; 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() {
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @min(
|
2010-08-03 16:19:16 +00:00
|
|
|
%i = alloca i8
|
2011-09-26 20:15:56 +00:00
|
|
|
%j = atomicrmw min i8* %i, i8 42 monotonic
|
2010-08-03 16:19:16 +00:00
|
|
|
; CHECK: [[INST:%[a-z0-9]+]] = load
|
|
|
|
; CHECK-NEXT: icmp
|
|
|
|
; CHECK-NEXT: select
|
|
|
|
; CHECK-NEXT: store
|
|
|
|
ret i8 %j
|
|
|
|
; CHECK: ret i8 [[INST]]
|
|
|
|
}
|