llvm/llvm/test/Transforms/AtomicExpand/PowerPC/issue55983.ll

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=atomic-expand -S -mtriple=powerpc64le-unknown-unknown \
; RUN:   %s | FileCheck %s
; RUN: opt -passes=atomic-expand -S -mtriple=powerpc64-unknown-unknown \
; RUN:   %s | FileCheck %s

define ptr @foo(ptr %p) {
; CHECK-LABEL: @foo(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[TMP0:%.*]] = load atomic ptr, ptr [[P:%.*]] monotonic, align 8
; CHECK-NEXT:    call void @llvm.ppc.cfence.p0(ptr [[TMP0]])
; CHECK-NEXT:    ret ptr [[TMP0]]
;
entry:
  %0 = load atomic ptr, ptr %p acquire, align 8
  ret ptr %0
}

define void @foobar(ptr addrspace(11) %p) {
; CHECK-LABEL: @foobar(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[TMP0:%.*]] = load atomic ptr addrspace(10), ptr addrspace(11) [[P:%.*]] monotonic, align 8
; CHECK-NEXT:    call void @llvm.ppc.cfence.p10(ptr addrspace(10) [[TMP0]])
; CHECK-NEXT:    unreachable
;
entry:
  %0 = load atomic ptr addrspace(10), ptr addrspace(11) %p acquire, align 8
  unreachable
}