diff options
author | Stephen Hines <srhines@google.com> | 2014-12-01 14:51:49 -0800 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2014-12-02 16:08:10 -0800 |
commit | 37ed9c199ca639565f6ce88105f9e39e898d82d0 (patch) | |
tree | 8fb36d3910e3ee4c4e1b7422f4f017108efc52f5 /test/CodeGen/PowerPC/asm-constraints.ll | |
parent | d2327b22152ced7bc46dc629fc908959e8a52d03 (diff) | |
download | external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.zip external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.gz external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.bz2 |
Update aosp/master LLVM for rebase to r222494.
Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
Diffstat (limited to 'test/CodeGen/PowerPC/asm-constraints.ll')
-rw-r--r-- | test/CodeGen/PowerPC/asm-constraints.ll | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/asm-constraints.ll b/test/CodeGen/PowerPC/asm-constraints.ll new file mode 100644 index 0000000..998b618 --- /dev/null +++ b/test/CodeGen/PowerPC/asm-constraints.ll @@ -0,0 +1,44 @@ +; RUN: llc < %s -mcpu=pwr8 | FileCheck %s + +; Generated from following C code: +; +; void foo (int result, char *addr) { +; __asm__ __volatile__ ( +; "ld%U1%X1 %0,%1\n" +; "cmpw %0,%0\n" +; "bne- 1f\n" +; "1: isync\n" +; : "=r" (result) +; : "m"(*addr) : "memory", "cr0"); +; } + +target datalayout = "e-m:e-i64:64-n32:64" +target triple = "powerpc64le-unknown-linux-gnu" + +; Function Attrs: nounwind +; Check that we accept 'U' and 'X' constraints. +define void @foo(i32 signext %result, i8* %addr) #0 { +entry: + %result.addr = alloca i32, align 4 + %addr.addr = alloca i8*, align 8 + store i32 %result, i32* %result.addr, align 4 + store i8* %addr, i8** %addr.addr, align 8 + %0 = load i8** %addr.addr, align 8 + %1 = call i32 asm sideeffect "ld${1:U}${1:X} $0,$1\0Acmpw $0,$0\0Abne- 1f\0A1: isync\0A", "=r,*m,~{memory},~{cr0}"(i8* %0) #1, !srcloc !1 + store i32 %1, i32* %result.addr, align 4 + ret void +} + +; CHECK-LABEL: @foo +; CHECK: ld [[REG:[0-9]+]],0(4) +; CHECK-NEXT: cmpw [[REG]],[[REG]] +; CHECK-NEXT: bne- 1f +; CHECK-NEXT: 1: isync + +attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #1 = { nounwind } + +!llvm.ident = !{!0} + +!0 = metadata !{metadata !"clang version 3.6.0 (trunk 217557)"} +!1 = metadata !{i32 67, i32 91, i32 110, i32 126} |