1# RUN: not llvm-mc -triple i386-linux-gnu %s 2>&1 | FileCheck %s
2
3# This test is a negative test for the altmacro expression.
4# In this test we check the '.noaltmacro' directive.
5# We expect that '.altmacro' and '.noaltmacro' will act as a switch on/off directives to the alternate macro mode.
6# .noaltmacro returns the format into a regular macro handling.
7# The default mode is ".noaltmacro" as first test checks.
8
9# CHECK:  error: expected immediate expression
10# CHECK-NEXT: addl $%(1%4), %eax
11.macro inner_percent arg
12    addl $\arg, %eax
13.endm
14
15inner_percent %(1%4)
16
17.altmacro
18.noaltmacro
19
20# CHECK: multi_args_macro %(1+4-5) 1 %2+1
21# CHECK: error: expected immediate expression
22# CHECK-NEXT: addl $%(1+4-5), %eax
23
24
25# CHECK: multi_args_macro %(1+4-5),1,%4%10
26# CHECK: error: expected immediate expression
27# CHECK-NEXT: addl $%(1+4-5), %eax
28.macro multi_args_macro arg1 arg2 arg3
29  label\arg1\arg2\arg3:
30  addl $\arg1, %eax
31.endm
32
33multi_args_macro %(1+4-5) 1 %2+1
34multi_args_macro %(1+4-5),1,%4%10
35