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