1# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 \
2# RUN:     2>%t1 | FileCheck %s
3# RUN: FileCheck -check-prefix=WARNINGS %s < %t1
4
5# Check that the assembler can handle the documented syntax for ".set at" and
6# will set the correct value for $at.
7# Note that writing $at is always the same as writing $1.
8
9    .text
10foo:
11# CHECK:   jr    $1                      # encoding: [0x08,0x00,0x20,0x00]
12# WARNINGS: :[[@LINE+2]]:11: warning: used $at (currently $1) without ".set noat"
13    .set    at=$1
14    jr    $at
15
16# CHECK:   jr    $1                      # encoding: [0x08,0x00,0x20,0x00]
17# WARNINGS: :[[@LINE+2]]:11: warning: used $at (currently $1) without ".set noat"
18    .set    at=$1
19    jr    $1
20
21# CHECK:   jr    $1                      # encoding: [0x08,0x00,0x20,0x00]
22# WARNINGS: :[[@LINE+2]]:11: warning: used $at (currently $1) without ".set noat"
23    .set    at=$at
24    jr    $at
25
26# CHECK:   jr    $1                      # encoding: [0x08,0x00,0x20,0x00]
27# WARNINGS: :[[@LINE+2]]:11: warning: used $at (currently $1) without ".set noat"
28    .set    at=$at
29    jr    $1
30
31# WARNINGS-NOT: warning: used $at (currently ${{[0-9]+}}) without ".set noat"
32# CHECK:   jr    $1                      # encoding: [0x08,0x00,0x20,0x00]
33    .set    at=$2
34    jr    $at
35# CHECK:   jr    $1                      # encoding: [0x08,0x00,0x20,0x00]
36    .set    at=$3
37    jr    $at
38# CHECK:   jr    $1                      # encoding: [0x08,0x00,0x20,0x00]
39    .set noat
40    jr    $at
41# CHECK:   jr    $1                      # encoding: [0x08,0x00,0x20,0x00]
42    .set at=$0
43    jr    $at
44
45# CHECK:   jr    $16                     # encoding: [0x08,0x00,0x00,0x02]
46# WARNINGS: :[[@LINE+2]]:11: warning: used $at (currently $16) without ".set noat"
47    .set    at=$16
48    jr    $s0
49
50# CHECK:   jr    $16                     # encoding: [0x08,0x00,0x00,0x02]
51# WARNINGS: :[[@LINE+2]]:11: warning: used $at (currently $16) without ".set noat"
52    .set    at=$16
53    jr    $16
54