forked from OSchip/llvm-project
Actually switch the arch when we see .arch. PR21695
llvm-svn: 249165
This commit is contained in:
parent
8d67b8e053
commit
4b5507a037
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue