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