summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2015-01-11 04:39:24 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2015-01-11 04:39:24 +0000
commit9cf2679d3bb7272e1a398bf0e4fae59970c666b6 (patch)
treea19d39768a48dd10c7afeab8644da9817f4c9041 /llvm/test
parentfe781977b9974b9669462df2ce8986258a25d080 (diff)
downloadbcm5719-llvm-9cf2679d3bb7272e1a398bf0e4fae59970c666b6.tar.gz
bcm5719-llvm-9cf2679d3bb7272e1a398bf0e4fae59970c666b6.zip
X86: teach X86TargetLowering about L,M,O constraints
Teach the ISelLowering for X86 about the L,M,O target specific constraints. Although, for the moment, clang performs constraint validation and prevents passing along inline asm which may have immediate constant constraints violated, the backend should be able to cope with the invalid inline asm a bit better. llvm-svn: 225596
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/x86-inline-asm-validation.ll34
1 files changed, 34 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/x86-inline-asm-validation.ll b/llvm/test/CodeGen/X86/x86-inline-asm-validation.ll
new file mode 100644
index 00000000000..56bdc48b0e4
--- /dev/null
+++ b/llvm/test/CodeGen/X86/x86-inline-asm-validation.ll
@@ -0,0 +1,34 @@
+; RUN: llc -mtriple i686-gnu -filetype asm -o - %s 2>&1 | FileCheck %s
+
+define void @test_L_ff() {
+entry:
+ call void asm "", "L,~{dirflag},~{fpsr},~{flags}"(i32 255)
+ ret void
+}
+
+; CHECK-NOT: error: invalid operand for inline asm constraint 'L'
+
+define void @test_L_ffff() {
+entry:
+ call void asm "", "L,~{dirflag},~{fpsr},~{flags}"(i32 65535)
+ ret void
+}
+
+; CHECK-NOT: error: invalid operand for inline asm constraint 'L'
+
+define void @test_M_1() {
+entry:
+ call void asm "", "M,~{dirflag},~{fpsr},~{flags}"(i32 1)
+ ret void
+}
+
+; CHECK-NOT: error: invalid operand for inline asm constraint 'M'
+
+define void @test_O_64() {
+entry:
+ call void asm "", "O,~{dirflag},~{fpsr},~{flags}"(i32 64)
+ ret void
+}
+
+; CHECK-NOT: error: invalid operand for inline asm constraint 'O'
+
OpenPOWER on IntegriCloud