diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-03-29 20:33:07 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-03-29 20:33:07 +0000 |
commit | 9de151ee5d6b6c7311e6e497cfb8507902652da4 (patch) | |
tree | ba8e05face6778f9e64d5602d23153cd124dd19f /llvm/test/CodeGen/X86/inline-asm-duplicated-constraint.ll | |
parent | 60be563f3deb80cbf89c4ccf77421963c39eec64 (diff) | |
download | bcm5719-llvm-9de151ee5d6b6c7311e6e497cfb8507902652da4.tar.gz bcm5719-llvm-9de151ee5d6b6c7311e6e497cfb8507902652da4.zip |
[inline asm] Don't reject duplicated matching constraints
They're harmless and it's easy to generate them from clang, leading to
a crash in LLVM. Found by afl-fuzz.
llvm-svn: 233500
Diffstat (limited to 'llvm/test/CodeGen/X86/inline-asm-duplicated-constraint.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/inline-asm-duplicated-constraint.ll | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/inline-asm-duplicated-constraint.ll b/llvm/test/CodeGen/X86/inline-asm-duplicated-constraint.ll new file mode 100644 index 00000000000..2ef54749739 --- /dev/null +++ b/llvm/test/CodeGen/X86/inline-asm-duplicated-constraint.ll @@ -0,0 +1,12 @@ +; RUN: llc < %s -march=x86-64 -no-integrated-as -mtriple=x86_64-linux-gnu | FileCheck %s + +; CHECK-LABEL: test1: +; CHECK: movl (%rdi), %eax +; CHECK: nop +; CHECK: movl %eax, (%rdi) +; CHECK: ret +define void @test1(i32* %l) { + %load = load i32, i32* %l + call void asm "nop", "=*rmrm,0m0m,~{dirflag},~{fpsr},~{flags}"(i32* %l, i32 %load) + ret void +} |