[llvm] [PowerPC ][NFC] Add a test case for the function atomic_compare_exchange_weak (PR #141263)

zhijian lin via llvm-commits llvm-commits at lists.llvm.org
Tue May 27 07:50:12 PDT 2025


================
@@ -0,0 +1,100 @@
+; Test the generation of asm for the function:
+; int foo(_Atomic int *cp, int *old, int c) {
+;  return atomic_compare_exchange_weak_explicit(cp, old, c, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
+; }  
+
+; RUN: llc < %s -ppc-asm-full-reg-names  -mtriple=powerpc-ibm-aix -mcpu=pwr8  -verify-machineinstrs | FileCheck %s --check-prefix=CHECK
+; RUN: llc < %s -ppc-asm-full-reg-names  -mtriple=powerpc64-ibm-aix -mcpu=pwr8  -verify-machineinstrs | FileCheck %s --check-prefix=CHECK64
----------------
diggerlin wrote:

> should also use  -ppc-vsr-nums-as-vr
I do not think we need the option since there is no vsr related instructions in the test case.

https://github.com/llvm/llvm-project/pull/141263


More information about the llvm-commits mailing list