1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 05:52:53 +02:00
llvm-mirror/test/Transforms/AtomicExpand/X86/expand-atomic-rmw-initial-load.ll
Richard Diamond eb6992a477 Fix an alignment error in llvm::expandAtomicRMWToCmpXchg without breaking the build where X86 isn't enabled.
Summary: Divide the primitive size in bits by eight so the initial load's alignment is in bytes as expected. Tested with the included unit test.

Reviewers: rengolin, jfb

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11804

llvm-svn: 244229
2015-08-06 16:55:03 +00:00

12 lines
420 B
LLVM

; RUN: opt -S %s -atomic-expand -mtriple=i686-linux-gnu | FileCheck %s
; This file tests the function `llvm::expandAtomicRMWToCmpXchg`.
; It isn't technically target specific, but is exposed through a pass that is.
define i8 @test_initial_load(i8* %ptr, i8 %value) {
%res = atomicrmw nand i8* %ptr, i8 %value seq_cst
ret i8 %res
}
; CHECK-LABEL: @test_initial_load
; CHECK-NEXT: %1 = load i8, i8* %ptr, align 1