diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-08-17 23:24:29 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-08-17 23:24:29 +0000 |
commit | fd45fa1503de725801be3db33c7e860298fc82a3 (patch) | |
tree | 9a7af8cabc644666e88023d923796c420f437276 /test | |
parent | 1cec7a05ee41725ec97b41608fe16d58c8c5b103 (diff) | |
download | external_llvm-fd45fa1503de725801be3db33c7e860298fc82a3.zip external_llvm-fd45fa1503de725801be3db33c7e860298fc82a3.tar.gz external_llvm-fd45fa1503de725801be3db33c7e860298fc82a3.tar.bz2 |
Make atomic load and store of pointers work. Tighten verification of atomic operations
so other unexpected operations don't slip through. Based on patch by Logan Chien.
PR11786/PR13186.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162146 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/X86/atomic-pointer.ll | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGen/X86/atomic-pointer.ll b/test/CodeGen/X86/atomic-pointer.ll new file mode 100644 index 0000000..a455277 --- /dev/null +++ b/test/CodeGen/X86/atomic-pointer.ll @@ -0,0 +1,22 @@ +; RUN: llc < %s -mtriple=i686-none-linux | FileCheck %s + +define i32* @test_atomic_ptr_load(i32** %a0) { +; CHECK: test_atomic_ptr_load +; CHECK: movl +; CHECK: movl +; CHECK: ret +0: + %0 = load atomic i32** %a0 seq_cst, align 4 + ret i32* %0 +} + +define void @test_atomic_ptr_store(i32* %a0, i32** %a1) { +; CHECK: test_atomic_ptr_store +; CHECK: movl +; CHECK: movl +; CHECK: xchgl +; CHECK: ret +0: + store atomic i32* %a0, i32** %a1 seq_cst, align 4 + ret void +} |