[llvm] 7defbf9 - [StackProtector] Add test for atomicrmw xchg (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 27 08:04:21 PST 2025
Author: Nikita Popov
Date: 2025-02-27T17:03:24+01:00
New Revision: 7defbf987a551771c275129c70fe4e59dc5125cc
URL: https://github.com/llvm/llvm-project/commit/7defbf987a551771c275129c70fe4e59dc5125cc
DIFF: https://github.com/llvm/llvm-project/commit/7defbf987a551771c275129c70fe4e59dc5125cc.diff
LOG: [StackProtector] Add test for atomicrmw xchg (NFC)
This is an opt based test because usually AtomicExpand will
convert it to an integer atomicrmw first.
Added:
llvm/test/CodeGen/X86/stack-protector-atomicrmw-xchg.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/stack-protector-atomicrmw-xchg.ll b/llvm/test/CodeGen/X86/stack-protector-atomicrmw-xchg.ll
new file mode 100644
index 0000000000000..a67643fa4530a
--- /dev/null
+++ b/llvm/test/CodeGen/X86/stack-protector-atomicrmw-xchg.ll
@@ -0,0 +1,14 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt -S -mtriple=x86_64-unknown-linux-gnu -passes=stack-protector < %s | FileCheck %s
+
+define void @atomicrmw_xchg(ptr %p) sspstrong {
+; CHECK-LABEL: define void @atomicrmw_xchg(
+; CHECK-SAME: ptr [[P:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT: [[A:%.*]] = alloca i64, align 8
+; CHECK-NEXT: [[TMP1:%.*]] = atomicrmw xchg ptr [[P]], ptr [[A]] acquire, align 8
+; CHECK-NEXT: ret void
+;
+ %a = alloca i64
+ atomicrmw xchg ptr %p, ptr %a acquire
+ ret void
+}
More information about the llvm-commits
mailing list