2009-07-18 06:38:58 +08:00
|
|
|
// RUN: llvm-mc -triple i386-unknown-unknown %s > %t
|
2009-06-30 10:10:03 +08:00
|
|
|
|
2010-10-26 04:18:41 +08:00
|
|
|
.macro check_expr
|
|
|
|
.if ($0) != ($1)
|
|
|
|
.abort Unexpected $0 != $1.
|
|
|
|
.endif
|
|
|
|
.endmacro
|
|
|
|
|
2009-06-30 10:10:03 +08:00
|
|
|
.text
|
|
|
|
g:
|
|
|
|
h:
|
|
|
|
j:
|
|
|
|
k:
|
|
|
|
.data
|
2010-10-26 04:18:41 +08:00
|
|
|
check_expr !1 + 2, 2
|
|
|
|
check_expr !0, 1
|
2010-10-26 04:18:49 +08:00
|
|
|
check_expr ~0, -1
|
|
|
|
check_expr -1, ~0
|
2010-10-26 04:18:41 +08:00
|
|
|
check_expr +1, 1
|
|
|
|
check_expr 1 + 2, 3
|
|
|
|
check_expr 1 & 3, 1
|
2010-10-26 04:18:53 +08:00
|
|
|
check_expr 4 / 2, 2
|
|
|
|
check_expr 4 / -2, -2
|
2010-10-26 04:18:41 +08:00
|
|
|
check_expr 1 == 1, 1
|
|
|
|
check_expr 1 == 0, 0
|
|
|
|
check_expr 1 > 0, 1
|
|
|
|
check_expr 1 >= 1, 1
|
|
|
|
check_expr 1 < 2, 1
|
|
|
|
check_expr 1 <= 1, 1
|
|
|
|
check_expr 4 % 3, 1
|
|
|
|
check_expr 2 * 2, 4
|
|
|
|
check_expr 2 != 2, 0
|
|
|
|
check_expr 2 <> 2, 0
|
|
|
|
check_expr 1 | 2, 3
|
|
|
|
check_expr 1 << 1, 2
|
|
|
|
check_expr 2 >> 1, 1
|
2010-10-26 04:18:49 +08:00
|
|
|
check_expr (~0 >> 1), -1
|
2010-10-26 04:18:41 +08:00
|
|
|
check_expr 3 - 2, 1
|
|
|
|
check_expr 1 ^ 3, 2
|
|
|
|
check_expr 1 && 2, 1
|
|
|
|
check_expr 3 && 0, 0
|
|
|
|
check_expr 0 && 1, 0
|
|
|
|
check_expr 1 || 2, 1
|
|
|
|
check_expr 0 || 1, 1
|
|
|
|
check_expr 0 || 0, 0
|
2010-10-26 04:18:56 +08:00
|
|
|
check_expr 1 + 2 < 3 + 4, 1
|
|
|
|
|
2009-06-30 04:37:27 +08:00
|
|
|
.set c, 10
|
2010-10-26 04:18:41 +08:00
|
|
|
check_expr c + 1, 11
|
2009-06-30 10:10:03 +08:00
|
|
|
|
|
|
|
d = e + 10
|
|
|
|
.long d
|
|
|
|
|
|
|
|
f = g - h + 5
|
|
|
|
.long f
|
|
|
|
|
|
|
|
i = (j + 10) - (k + 2)
|
|
|
|
.long i
|
|
|
|
|
2009-07-01 06:49:27 +08:00
|
|
|
l = m - n + 4
|
|
|
|
|
|
|
|
.text
|
|
|
|
m:
|
|
|
|
n:
|
|
|
|
nop
|
|
|
|
|
2009-07-18 06:38:58 +08:00
|
|
|
|
2010-01-24 09:07:33 +08:00
|
|
|
movw $8, (42)+66(%eax)
|
2010-04-14 12:40:28 +08:00
|
|
|
|
|
|
|
// "." support:
|
|
|
|
_f0:
|
|
|
|
L0:
|
|
|
|
jmp L1
|
|
|
|
.long . - L0
|
|
|
|
L1:
|
|
|
|
jmp A
|
|
|
|
.long . - L1
|