[mips] Add error message when trying to use $at in '.set noat' mode.
[oota-llvm.git] / test / MC / Mips / mips-noat.s
1 # RUN: not llvm-mc %s -triple=mips-unknown-linux 2>%t0 | FileCheck %s
2 # RUN: FileCheck -check-prefix=ERROR %s < %t0
3
4 # We start with $at enabled
5 # CHECK-LABEL: test1:
6 # CHECK:  lui   $1, 1
7 # CHECK:  addu  $1, $1, $2
8 # CHECK:  lw    $2, 0($1)
9 test1:
10         lw      $2, 65536($2)
11
12 # Check that using $at when .set noat is in effect is an error.
13 # FIXME: It would be better if the error pointed at the mnemonic instead of the newline
14 # ERROR: mips-noat.s:[[@LINE+5]]:1: error: Pseudo instruction requires $at, which is not available
15 # ERROR-NOT: error
16 test2:
17         .set noat
18         lw      $2, 65536($2)
19
20 # Can we switch it back on successfully?
21 # CHECK-LABEL: test3:
22 # CHECK:  lui   $1, 1
23 # CHECK:  addu  $1, $1, $2
24 # CHECK:  lw    $2, 0($1)
25 test3:
26         .set at
27         lw      $2, 65536($2)