2014-04-23 14:56:28 +08:00
|
|
|
// RUN: llvm-mc -triple x86_64-linux-gnu %s | FileCheck %s
|
|
|
|
.macro ifcc arg:vararg
|
|
|
|
.if cc
|
|
|
|
\arg
|
|
|
|
.endif
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro ifcc2 arg0 arg1:vararg
|
|
|
|
.if cc
|
|
|
|
movl \arg0, \arg1
|
|
|
|
.endif
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro ifcc3 arg0, arg1:vararg
|
|
|
|
.if cc
|
|
|
|
movl \arg0, \arg1
|
|
|
|
.endif
|
|
|
|
.endm
|
|
|
|
|
2014-06-19 04:57:32 +08:00
|
|
|
.macro ifcc4 arg0, arg1:vararg
|
|
|
|
.if cc
|
|
|
|
movl \arg1, \arg0
|
|
|
|
.endif
|
|
|
|
.endm
|
|
|
|
|
2014-04-23 14:56:28 +08:00
|
|
|
.text
|
|
|
|
|
|
|
|
// CHECK: movl %esp, %ebp
|
|
|
|
// CHECK: subl $0, %esp
|
|
|
|
// CHECK: movl %eax, %ebx
|
|
|
|
// CHECK: movl %ecx, %ebx
|
|
|
|
// CHECK: movl %ecx, %eax
|
|
|
|
// CHECK: movl %eax, %ecx
|
2014-06-19 04:57:32 +08:00
|
|
|
// CHECK: movl %ecx, %eax
|
|
|
|
// CHECK: movl %eax, %ecx
|
2014-04-23 14:56:28 +08:00
|
|
|
.set cc,1
|
|
|
|
ifcc movl %esp, %ebp
|
|
|
|
subl $0, %esp
|
|
|
|
|
|
|
|
ifcc2 %eax %ebx
|
|
|
|
ifcc2 %ecx, %ebx
|
|
|
|
ifcc3 %ecx %eax
|
|
|
|
ifcc3 %eax, %ecx
|
2014-06-19 04:57:32 +08:00
|
|
|
ifcc4 %eax %ecx ## test
|
|
|
|
ifcc4 %ecx, %eax ## test
|
2014-04-23 14:56:28 +08:00
|
|
|
|
2015-08-11 03:01:27 +08:00
|
|
|
// CHECK-NOT: movl
|
2014-04-23 14:56:28 +08:00
|
|
|
// CHECK: subl $1, %esp
|
|
|
|
.set cc,0
|
|
|
|
ifcc movl %esp, %ebp
|
|
|
|
subl $1, %esp
|