1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Actually switch the arch when we see .arch. PR21695

llvm-svn: 249165
This commit is contained in:
Roman Divacky 2015-10-02 18:25:25 +00:00
parent dadfb33120
commit b2d96904de
2 changed files with 17 additions and 0 deletions

View File

@ -15,6 +15,7 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ADT/Twine.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCAssembler.h"
@ -9023,6 +9024,10 @@ bool ARMAsmParser::parseDirectiveArch(SMLoc L) {
return false;
}
Triple T;
STI.setDefaultFeatures(T.getARMCPUForArch(Arch));
setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits()));
getTargetStreamer().emitArch(ID);
return false;
}

View File

@ -0,0 +1,12 @@
@ RUN: not llvm-mc -triple arm-gnueabi-linux -filetype asm %s 2>&1 | FileCheck %s
.arch armv6
dsb
@ CHECK: error: instruction requires: data-barriers
.arch armv7
dsb
@ CHECK-NOT: error: instruction requires: data-barriers
.arch invalid_architecture_name
@ CHECK: error: Unknown arch name