1# RUN: not llvm-mc -triple x86_64-unknown-unknown %s 2>&1 | FileCheck %s --check-prefix=ASM-ERR
2# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s | llvm-objdump -j .data  -s - | FileCheck %s --check-prefix=OBJDATA
3# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s | llvm-objdump -j .text -s - | FileCheck %s --check-prefix=OBJTEXT
4.data
5
6# OBJDATA: Contents of section .data
7# OBJDATA-NEXT: 0000 aa0506ff
8
9foo2:
10# ASM-ERR: [[@LINE+1]]:5: error: expected absolute expression
11.if . - foo2 == 0
12    .byte 0xaa
13.else
14    .byte 0x00
15.endif
16
17foo3:
18    .byte 5
19# ASM-ERR: [[@LINE+1]]:5: error: expected absolute expression
20.if . - foo3 == 1
21   .byte 6
22.else
23   .byte 7
24.endif
25
26.byte 0xff
27
28# nop is a fixed size instruction so this should pass.
29
30# OBJTEXT: Contents of section .text
31# OBJTEXT-NEXT: 0000 909090ff 34250000 00009090 90785634
32# OBJTEXT-NEXT: 0010 12785634 1290
33
34.text
35text1:
36# ASM-ERR: [[@LINE+1]]:5: error: expected absolute expression
37.if . - text1 == 0
38	nop
39.endif
40
41text2:
42        nop
43# ASM-ERR: [[@LINE+1]]:5: error: expected absolute expression
44.if . - text2 == 1
45	nop
46.else
47	ret
48.endif
49	push gs
50	nop
51	nop
52	nop
53# No additional errors.
54#
55# ASM-ERR-NOT: {{[0-9]+}}:{{[0-9]+}}: error:
56
57
58text3:
59	.long 0x12345678
60text4:
61	.fill (text4-text3)/4, 4, 0x12345678
62	nop
63
64
65
66
67
68
69