1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/test/Verifier/opaque-ptr.ll
Arthur Eubanks 9085f7d6c9 [OpaquePtr] Make atomicrmw work with opaque pointers
FullTy is only necessary when we need to figure out what type an
instruction works with given a pointer's pointee type. However, we just
end up using the value operand's type, so FullTy isn't necessary.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D102788
2021-05-25 20:16:21 -07:00

26 lines
501 B
LLVM

; RUN: opt -passes=verify -S < %s | FileCheck %s
; CHECK: @load
define i32 @load(ptr %a) {
%i = load i32, ptr %a
ret i32 %i
}
; CHECK: @store
define void @store(ptr %a, i32 %i) {
store i32 %i, ptr %a
ret void
}
; CHECK: @cmpxchg
define void @cmpxchg(ptr %p, i32 %a, i32 %b) {
%val_success = cmpxchg ptr %p, i32 %a, i32 %b acq_rel monotonic
ret void
}
; CHECK: @atomicrmw
define void @atomicrmw(ptr %a, i32 %i) {
%b = atomicrmw add ptr %a, i32 %i acquire
ret void
}