[llvm] d8c2a10 - [X86] Add negative test for D145930

Nabeel Omer via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 14 04:41:11 PDT 2023


Author: Nabeel Omer
Date: 2023-03-14T11:29:38Z
New Revision: d8c2a10297f19b708ed0dae8d0fe8415a0f8e5e8

URL: https://github.com/llvm/llvm-project/commit/d8c2a10297f19b708ed0dae8d0fe8415a0f8e5e8
DIFF: https://github.com/llvm/llvm-project/commit/d8c2a10297f19b708ed0dae8d0fe8415a0f8e5e8.diff

LOG: [X86] Add negative test for D145930

This patch adds a negative test for the issue discovered in D145930.

Differential Revision: https://reviews.llvm.org/D145933

Added: 
    llvm/test/CodeGen/X86/pr61384.ll

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/X86/pr61384.ll b/llvm/test/CodeGen/X86/pr61384.ll
new file mode 100644
index 0000000000000..cf17b3d4b73ad
--- /dev/null
+++ b/llvm/test/CodeGen/X86/pr61384.ll
@@ -0,0 +1,19 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -mtriple=x86_64-unknown-linux-gnu -show-mc-encoding < %s | FileCheck %s
+
+ at a = external dso_local global { { i64 } }
+
+define i32 @atomic_global() nounwind {
+; CHECK-LABEL: atomic_global:
+; CHECK:       # %bb.0: # %entry
+; CHECK-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; CHECK-NEXT:    lock btsq %rax, a(%rip) # encoding: [0xf0,0x48,0x0f,0xab,0x05,A,A,A,A]
+; CHECK-NEXT:    # fixup A - offset: 5, value: a-5, kind: reloc_riprel_4byte
+; CHECK-NEXT:    xorl %eax, %eax # encoding: [0x31,0xc0]
+; CHECK-NEXT:    retq # encoding: [0xc3]
+entry:
+  %shl.i = shl i64 1, 0
+  %0 = atomicrmw or ptr @a, i64 %shl.i monotonic, align 8
+  %and.i = and i64 %shl.i, %0
+  ret i32 0
+}


        


More information about the llvm-commits mailing list