llvm.org GIT mirror llvm / 7135d8b
[Targets] Add errors for tiny and kernel codemodel on targets that don't support them Adds fatal errors for any target that does not support the Tiny or Kernel codemodels by rejigging the getEffectiveCodeModel calls. Differential Revision: https://reviews.llvm.org/D50141 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348585 91177308-0d34-0410-b5e6-96231b3b80d8 David Green 1 year, 11 months ago
27 changed file(s) with 131 addition(s) and 119 deletion(s). Raw diff Collapse all Expand all
353353 }
354354 };
355355
356 /// Helper method for getting the code model, returning Default if
357 /// CM does not have a value. The tiny and kernel models will produce
358 /// an error, so targets that support them or require more complex codemodel
359 /// selection logic should implement and call their own getEffectiveCodeModel.
360 inline CodeModel::Model getEffectiveCodeModel(Optional CM,
361 CodeModel::Model Default) {
362 if (CM) {
363 // By default, targets do not support the tiny and kernel models.
364 if (*CM == CodeModel::Tiny)
365 report_fatal_error("Target does not support the tiny CodeModel");
366 if (*CM == CodeModel::Kernel)
367 report_fatal_error("Target does not support the kernel CodeModel");
368 return *CM;
369 }
370 return Default;
371 }
372
356373 } // end namespace llvm
357374
358375 #endif // LLVM_TARGET_TARGETMACHINE_H
218218 return *RM;
219219 }
220220
221 static CodeModel::Model getEffectiveCodeModel(const Triple &TT,
222 Optional CM,
223 bool JIT) {
221 static CodeModel::Model
222 getEffectiveAArch64CodeModel(const Triple &TT, Optional CM,
223 bool JIT) {
224224 if (CM) {
225225 if (*CM != CodeModel::Small && *CM != CodeModel::Tiny &&
226226 *CM != CodeModel::Large) {
254254 : LLVMTargetMachine(T,
255255 computeDataLayout(TT, Options.MCOptions, LittleEndian),
256256 TT, CPU, FS, Options, getEffectiveRelocModel(TT, RM),
257 getEffectiveCodeModel(TT, CM, JIT), OL),
257 getEffectiveAArch64CodeModel(TT, CM, JIT), OL),
258258 TLOF(createTLOF(getTargetTriple())), isLittle(LittleEndian) {
259259 initAsmInfo();
260260
309309 return Reloc::PIC_;
310310 }
311311
312 static CodeModel::Model getEffectiveCodeModel(Optional CM) {
313 if (CM)
314 return *CM;
315 return CodeModel::Small;
316 }
317
318312 AMDGPUTargetMachine::AMDGPUTargetMachine(const Target &T, const Triple &TT,
319313 StringRef CPU, StringRef FS,
320314 TargetOptions Options,
323317 CodeGenOpt::Level OptLevel)
324318 : LLVMTargetMachine(T, computeDataLayout(TT), TT, getGPUOrDefault(TT, CPU),
325319 FS, Options, getEffectiveRelocModel(RM),
326 getEffectiveCodeModel(CM), OptLevel),
320 getEffectiveCodeModel(CM, CodeModel::Small), OptLevel),
327321 TLOF(createTLOF(getTargetTriple())) {
328322 initAsmInfo();
329323 }
2525 return *RM;
2626 }
2727
28 static CodeModel::Model getEffectiveCodeModel(Optional CM) {
29 if (CM)
30 return *CM;
31 return CodeModel::Small;
32 }
33
3428 /// ARCTargetMachine ctor - Create an ILP32 architecture model
3529 ARCTargetMachine::ARCTargetMachine(const Target &T, const Triple &TT,
3630 StringRef CPU, StringRef FS,
4236 "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-"
4337 "f32:32:32-i64:32-f64:32-a:0:32-n32",
4438 TT, CPU, FS, Options, getRelocModel(RM),
45 getEffectiveCodeModel(CM), OL),
39 getEffectiveCodeModel(CM, CodeModel::Small), OL),
4640 TLOF(make_unique()),
4741 Subtarget(TT, CPU, FS, *this) {
4842 initAsmInfo();
193193 return *RM;
194194 }
195195
196 static CodeModel::Model getEffectiveCodeModel(Optional CM) {
197 if (CM)
198 return *CM;
199 return CodeModel::Small;
200 }
201
202196 /// Create an ARM architecture model.
203197 ///
204198 ARMBaseTargetMachine::ARMBaseTargetMachine(const Target &T, const Triple &TT,
209203 CodeGenOpt::Level OL, bool isLittle)
210204 : LLVMTargetMachine(T, computeDataLayout(TT, CPU, Options, isLittle), TT,
211205 CPU, FS, Options, getEffectiveRelocModel(TT, RM),
212 getEffectiveCodeModel(CM), OL),
206 getEffectiveCodeModel(CM, CodeModel::Small), OL),
213207 TargetABI(computeTargetABI(TT, CPU, Options)),
214208 TLOF(createTLOF(getTargetTriple())), isLittle(isLittle) {
215209
3939 return RM.hasValue() ? *RM : Reloc::Static;
4040 }
4141
42 static CodeModel::Model getEffectiveCodeModel(Optional CM) {
43 if (CM)
44 return *CM;
45 return CodeModel::Small;
46 }
47
4842 AVRTargetMachine::AVRTargetMachine(const Target &T, const Triple &TT,
4943 StringRef CPU, StringRef FS,
5044 const TargetOptions &Options,
5246 Optional CM,
5347 CodeGenOpt::Level OL, bool JIT)
5448 : LLVMTargetMachine(T, AVRDataLayout, TT, getCPU(CPU), FS, Options,
55 getEffectiveRelocModel(RM), getEffectiveCodeModel(CM),
56 OL),
49 getEffectiveRelocModel(RM),
50 getEffectiveCodeModel(CM, CodeModel::Small), OL),
5751 SubTarget(TT, getCPU(CPU), FS, *this) {
5852 this->TLOF = make_unique();
5953 initAsmInfo();
5050 return *RM;
5151 }
5252
53 static CodeModel::Model getEffectiveCodeModel(Optional CM) {
54 if (CM)
55 return *CM;
56 return CodeModel::Small;
57 }
58
5953 BPFTargetMachine::BPFTargetMachine(const Target &T, const Triple &TT,
6054 StringRef CPU, StringRef FS,
6155 const TargetOptions &Options,
6357 Optional CM,
6458 CodeGenOpt::Level OL, bool JIT)
6559 : LLVMTargetMachine(T, computeDataLayout(TT), TT, CPU, FS, Options,
66 getEffectiveRelocModel(RM), getEffectiveCodeModel(CM),
67 OL),
60 getEffectiveRelocModel(RM),
61 getEffectiveCodeModel(CM, CodeModel::Small), OL),
6862 TLOF(make_unique()),
6963 Subtarget(TT, CPU, FS, *this) {
7064 initAsmInfo();
179179 return *RM;
180180 }
181181
182 static CodeModel::Model getEffectiveCodeModel(Optional CM) {
183 if (CM)
184 return *CM;
185 return CodeModel::Small;
186 }
187
188182 extern "C" void LLVMInitializeHexagonTarget() {
189183 // Register the target.
190184 RegisterTargetMachine X(getTheHexagonTarget());
221215 "i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-"
222216 "v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048",
223217 TT, CPU, FS, Options, getEffectiveRelocModel(RM),
224 getEffectiveCodeModel(CM), (HexagonNoOpt ? CodeGenOpt::None : OL)),
218 getEffectiveCodeModel(CM, CodeModel::Small),
219 (HexagonNoOpt ? CodeGenOpt::None : OL)),
225220 TLOF(make_unique()) {
226221 initializeHexagonExpandCondsetsPass(*PassRegistry::getPassRegistry());
227222 initAsmInfo();
5252 return *RM;
5353 }
5454
55 static CodeModel::Model getEffectiveCodeModel(Optional CM) {
56 if (CM)
57 return *CM;
58 return CodeModel::Medium;
59 }
60
6155 LanaiTargetMachine::LanaiTargetMachine(const Target &T, const Triple &TT,
6256 StringRef Cpu, StringRef FeatureString,
6357 const TargetOptions &Options,
6660 CodeGenOpt::Level OptLevel, bool JIT)
6761 : LLVMTargetMachine(T, computeDataLayout(), TT, Cpu, FeatureString, Options,
6862 getEffectiveRelocModel(RM),
69 getEffectiveCodeModel(CodeModel), OptLevel),
63 getEffectiveCodeModel(CodeModel, CodeModel::Medium),
64 OptLevel),
7065 Subtarget(TT, Cpu, FeatureString, *this, Options, getCodeModel(),
7166 OptLevel),
7267 TLOF(new LanaiTargetObjectFile()) {
3131 return *RM;
3232 }
3333
34 static CodeModel::Model getEffectiveCodeModel(Optional CM) {
35 if (CM)
36 return *CM;
37 return CodeModel::Small;
38 }
39
4034 static std::string computeDataLayout(const Triple &TT, StringRef CPU,
4135 const TargetOptions &Options) {
4236 return "e-m:e-p:16:16-i32:16-i64:16-f32:16-f64:16-a:8-n8:16-S16";
5044 CodeGenOpt::Level OL, bool JIT)
5145 : LLVMTargetMachine(T, computeDataLayout(TT, CPU, Options), TT, CPU, FS,
5246 Options, getEffectiveRelocModel(RM),
53 getEffectiveCodeModel(CM), OL),
47 getEffectiveCodeModel(CM, CodeModel::Small), OL),
5448 TLOF(make_unique()),
5549 Subtarget(TT, CPU, FS, *this) {
5650 initAsmInfo();
100100 return *RM;
101101 }
102102
103 static CodeModel::Model getEffectiveCodeModel(Optional CM) {
104 if (CM)
105 return *CM;
106 return CodeModel::Small;
107 }
108
109103 // On function prologue, the stack is created by decrementing
110104 // its pointer. Once decremented, all references are done with positive
111105 // offset from the stack/frame pointer, using StackGrowsUp enables
120114 bool isLittle)
121115 : LLVMTargetMachine(T, computeDataLayout(TT, CPU, Options, isLittle), TT,
122116 CPU, FS, Options, getEffectiveRelocModel(JIT, RM),
123 getEffectiveCodeModel(CM), OL),
117 getEffectiveCodeModel(CM, CodeModel::Small), OL),
124118 isLittle(isLittle), TLOF(llvm::make_unique()),
125119 ABI(MipsABIInfo::computeTargetABI(TT, CPU, Options.MCOptions)),
126120 Subtarget(nullptr), DefaultSubtarget(TT, CPU, FS, isLittle, *this,
101101 return Ret;
102102 }
103103
104 static CodeModel::Model getEffectiveCodeModel(Optional CM) {
105 if (CM)
106 return *CM;
107 return CodeModel::Small;
108 }
109
110104 NVPTXTargetMachine::NVPTXTargetMachine(const Target &T, const Triple &TT,
111105 StringRef CPU, StringRef FS,
112106 const TargetOptions &Options,
117111 // specified, as it is the only relocation model currently supported.
118112 : LLVMTargetMachine(T, computeDataLayout(is64bit, UseShortPointersOpt), TT,
119113 CPU, FS, Options, Reloc::PIC_,
120 getEffectiveCodeModel(CM), OL),
114 getEffectiveCodeModel(CM, CodeModel::Small), OL),
121115 is64bit(is64bit), UseShortPointers(UseShortPointersOpt),
122116 TLOF(llvm::make_unique()),
123117 Subtarget(TT, CPU, FS, *this) {
3636 return *RM;
3737 }
3838
39 static CodeModel::Model getEffectiveCodeModel(Optional CM,
40 Reloc::Model RM, bool JIT) {
41 if (CM)
42 return *CM;
43 return CodeModel::Small;
44 }
45
4639 Nios2TargetMachine::Nios2TargetMachine(const Target &T, const Triple &TT,
4740 StringRef CPU, StringRef FS,
4841 const TargetOptions &Options,
4942 Optional RM,
5043 Optional CM,
5144 CodeGenOpt::Level OL, bool JIT)
52 : LLVMTargetMachine(
53 T, computeDataLayout(), TT, CPU, FS, Options,
54 getEffectiveRelocModel(RM),
55 getEffectiveCodeModel(CM, getEffectiveRelocModel(RM), JIT), OL),
45 : LLVMTargetMachine(T, computeDataLayout(), TT, CPU, FS, Options,
46 getEffectiveRelocModel(RM),
47 getEffectiveCodeModel(CM, CodeModel::Small), OL),
5648 TLOF(make_unique()),
5749 Subtarget(TT, CPU, FS, *this) {
5850 initAsmInfo();
221221 return Reloc::Static;
222222 }
223223
224 static CodeModel::Model getEffectiveCodeModel(const Triple &TT,
225 Optional CM,
226 bool JIT) {
227 if (CM)
224 static CodeModel::Model getEffectivePPCCodeModel(const Triple &TT,
225 Optional CM,
226 bool JIT) {
227 if (CM) {
228 if (*CM == CodeModel::Tiny)
229 report_fatal_error("Target does not support the tiny CodeModel");
230 if (*CM == CodeModel::Kernel)
231 report_fatal_error("Target does not support the kernel CodeModel");
228232 return *CM;
233 }
229234 if (!TT.isOSDarwin() && !JIT &&
230235 (TT.getArch() == Triple::ppc64 || TT.getArch() == Triple::ppc64le))
231236 return CodeModel::Medium;
245250 : LLVMTargetMachine(T, getDataLayoutString(TT), TT, CPU,
246251 computeFSAdditions(FS, OL, TT), Options,
247252 getEffectiveRelocModel(TT, RM),
248 getEffectiveCodeModel(TT, CM, JIT), OL),
253 getEffectivePPCCodeModel(TT, CM, JIT), OL),
249254 TLOF(createTLOF(getTargetTriple())),
250255 TargetABI(computeTargetABI(TT, Options)) {
251256 initAsmInfo();
4646 return *RM;
4747 }
4848
49 static CodeModel::Model getEffectiveCodeModel(Optional CM) {
50 if (CM)
51 return *CM;
52 return CodeModel::Small;
53 }
54
5549 RISCVTargetMachine::RISCVTargetMachine(const Target &T, const Triple &TT,
5650 StringRef CPU, StringRef FS,
5751 const TargetOptions &Options,
6054 CodeGenOpt::Level OL, bool JIT)
6155 : LLVMTargetMachine(T, computeDataLayout(TT), TT, CPU, FS, Options,
6256 getEffectiveRelocModel(TT, RM),
63 getEffectiveCodeModel(CM), OL),
57 getEffectiveCodeModel(CM, CodeModel::Small), OL),
6458 TLOF(make_unique()),
6559 Subtarget(TT, CPU, FS, *this) {
6660 initAsmInfo();
6969 // pic32 PIC_ Medium GOT < 2^32 bytes
7070 //
7171 // All code models require that the text segment is smaller than 2GB.
72 static CodeModel::Model getEffectiveCodeModel(Optional CM,
73 Reloc::Model RM, bool Is64Bit,
74 bool JIT) {
75 if (CM)
72 static CodeModel::Model
73 getEffectiveSparcCodeModel(Optional CM, Reloc::Model RM,
74 bool Is64Bit, bool JIT) {
75 if (CM) {
76 if (*CM == CodeModel::Tiny)
77 report_fatal_error("Target does not support the tiny CodeModel");
78 if (*CM == CodeModel::Kernel)
79 report_fatal_error("Target does not support the kernel CodeModel");
7680 return *CM;
81 }
7782 if (Is64Bit) {
7883 if (JIT)
7984 return CodeModel::Large;
8792 const Target &T, const Triple &TT, StringRef CPU, StringRef FS,
8893 const TargetOptions &Options, Optional RM,
8994 Optional CM, CodeGenOpt::Level OL, bool JIT, bool is64bit)
90 : LLVMTargetMachine(
91 T, computeDataLayout(TT, is64bit), TT, CPU, FS, Options,
92 getEffectiveRelocModel(RM),
93 getEffectiveCodeModel(CM, getEffectiveRelocModel(RM), is64bit, JIT),
94 OL),
95 : LLVMTargetMachine(T, computeDataLayout(TT, is64bit), TT, CPU, FS, Options,
96 getEffectiveRelocModel(RM),
97 getEffectiveSparcCodeModel(
98 CM, getEffectiveRelocModel(RM), is64bit, JIT),
99 OL),
95100 TLOF(make_unique()),
96101 Subtarget(TT, CPU, FS, *this, is64bit), is64Bit(is64bit) {
97102 initAsmInfo();
127127 // in range of LARL. However, the JIT environment has no equivalent
128128 // of copy relocs, so locally-binding data symbols might not be in
129129 // the range of LARL. We need the Medium model in that case.
130 static CodeModel::Model getEffectiveCodeModel(Optional CM,
131 Reloc::Model RM, bool JIT) {
132 if (CM)
130 static CodeModel::Model
131 getEffectiveSystemZCodeModel(Optional CM, Reloc::Model RM,
132 bool JIT) {
133 if (CM) {
134 if (*CM == CodeModel::Tiny)
135 report_fatal_error("Target does not support the tiny CodeModel");
136 if (*CM == CodeModel::Kernel)
137 report_fatal_error("Target does not support the kernel CodeModel");
133138 return *CM;
139 }
134140 if (JIT)
135141 return RM == Reloc::PIC_ ? CodeModel::Small : CodeModel::Medium;
136142 return CodeModel::Small;
145151 : LLVMTargetMachine(
146152 T, computeDataLayout(TT, CPU, FS), TT, CPU, FS, Options,
147153 getEffectiveRelocModel(RM),
148 getEffectiveCodeModel(CM, getEffectiveRelocModel(RM), JIT), OL),
154 getEffectiveSystemZCodeModel(CM, getEffectiveRelocModel(RM), JIT),
155 OL),
149156 TLOF(llvm::make_unique()),
150157 Subtarget(TT, CPU, FS, *this) {
151158 initAsmInfo();
100100 TT.isArch64Bit() ? "e-m:e-p:64:64-i64:64-n32:64-S128"
101101 : "e-m:e-p:32:32-i64:64-n32:64-S128",
102102 TT, CPU, FS, Options, getEffectiveRelocModel(RM),
103 CM ? *CM : CodeModel::Large, OL),
103 getEffectiveCodeModel(CM, CodeModel::Large), OL),
104104 TLOF(new WebAssemblyTargetObjectFile()) {
105105 // WebAssembly type-checks instructions, but a noreturn function with a return
106106 // type that doesn't match the context will cause a check failure. So we lower
188188 return *RM;
189189 }
190190
191 static CodeModel::Model getEffectiveCodeModel(Optional CM,
192 bool JIT, bool Is64Bit) {
193 if (CM)
191 static CodeModel::Model getEffectiveX86CodeModel(Optional CM,
192 bool JIT, bool Is64Bit) {
193 if (CM) {
194 if (*CM == CodeModel::Tiny)
195 report_fatal_error("Target does not support the tiny CodeModel");
194196 return *CM;
197 }
195198 if (JIT)
196199 return Is64Bit ? CodeModel::Large : CodeModel::Small;
197200 return CodeModel::Small;
208211 : LLVMTargetMachine(
209212 T, computeDataLayout(TT), TT, CPU, FS, Options,
210213 getEffectiveRelocModel(TT, JIT, RM),
211 getEffectiveCodeModel(CM, JIT, TT.getArch() == Triple::x86_64), OL),
214 getEffectiveX86CodeModel(CM, JIT, TT.getArch() == Triple::x86_64),
215 OL),
212216 TLOF(createTLOF(getTargetTriple())) {
213217 // Windows stack unwinder gets confused when execution flow "falls through"
214218 // after a call to 'noreturn' function.
3030 return *RM;
3131 }
3232
33 static CodeModel::Model getEffectiveCodeModel(Optional CM) {
33 static CodeModel::Model
34 getEffectiveXCoreCodeModel(Optional CM) {
3435 if (CM) {
3536 if (*CM != CodeModel::Small && *CM != CodeModel::Large)
3637 report_fatal_error("Target only supports CodeModel Small or Large");
5051 : LLVMTargetMachine(
5152 T, "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:32-f64:32-a:0:32-n32",
5253 TT, CPU, FS, Options, getEffectiveRelocModel(RM),
53 getEffectiveCodeModel(CM), OL),
54 getEffectiveXCoreCodeModel(CM), OL),
5455 TLOF(llvm::make_unique()),
5556 Subtarget(TT, CPU, FS, *this) {
5657 initAsmInfo();
0 ; RUN: not llc -verify-machineinstrs -o - -mtriple=arm-none-eabi -code-model=tiny < %s 2>&1 | FileCheck %s --check-prefix=TINY
1 ; RUN: not llc -verify-machineinstrs -o - -mtriple=arm-none-eabi -code-model=kernel < %s 2>&1 | FileCheck %s --check-prefix=KERNEL
2
3 ; TINY: Target does not support the tiny CodeModel
4 ; KERNEL: Target does not support the kernel CodeModel
5
6 define void @foo() {
7 ret void
8 }
0 ; RUN: llc -march=lanai < %s | FileCheck %s
11 ; RUN: llc -march=lanai < %s -code-model=small | FileCheck -check-prefix CHECK-SMALL %s
2 ; RUN: not llc -march=lanai < %s -code-model=tiny 2>&1 | FileCheck -check-prefix CHECK-TINY %s
3 ; RUN: not llc -march=lanai < %s -code-model=kernel 2>&1 | FileCheck -check-prefix CHECK-KERNEL %s
4
5 ; CHECK-TINY: Target does not support the tiny CodeModel
6 ; CHECK-KERNEL: Target does not support the kernel CodeModel
27
38 @data = external global [0 x i32] ; <[0 x i32]*> [#uses=5]
49
0 ; RUN: not llc -verify-machineinstrs -o - -mtriple=arm-none-eabi -code-model=tiny < %s 2>&1 | FileCheck %s --check-prefix=TINY
1 ; RUN: not llc -verify-machineinstrs -o - -mtriple=arm-none-eabi -code-model=kernel < %s 2>&1 | FileCheck %s --check-prefix=KERNEL
2
3 ; TINY: Target does not support the tiny CodeModel
4 ; KERNEL: Target does not support the kernel CodeModel
5
6 define void @foo() {
7 ret void
8 }
0 ; RUN: not llc -verify-machineinstrs -o - -mtriple=arm-none-eabi -code-model=tiny < %s 2>&1 | FileCheck %s --check-prefix=TINY
1 ; RUN: not llc -verify-machineinstrs -o - -mtriple=arm-none-eabi -code-model=kernel < %s 2>&1 | FileCheck %s --check-prefix=KERNEL
2
3 ; TINY: Target does not support the tiny CodeModel
4 ; KERNEL: Target does not support the kernel CodeModel
5
6 define void @foo() {
7 ret void
8 }
0 ; RUN: not llc -verify-machineinstrs -o - -mtriple=arm-none-eabi -code-model=tiny < %s 2>&1 | FileCheck %s --check-prefix=TINY
1 ; RUN: not llc -verify-machineinstrs -o - -mtriple=arm-none-eabi -code-model=kernel < %s 2>&1 | FileCheck %s --check-prefix=KERNEL
2
3 ; TINY: Target does not support the tiny CodeModel
4 ; KERNEL: Target does not support the kernel CodeModel
5
6 define void @foo() {
7 ret void
8 }
0 ; RUN: llc < %s -code-model=small | FileCheck -check-prefix CHECK-SMALL %s
11 ; RUN: llc < %s -code-model=kernel | FileCheck -check-prefix CHECK-KERNEL %s
2 ; RUN: not llc < %s -code-model=tiny 2>&1 | FileCheck -check-prefix CHECK-TINY %s
23
34 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
45 target triple = "x86_64-unknown-linux-gnu"
56 @data = external global [0 x i32] ; <[0 x i32]*> [#uses=5]
7
8 ; CHECK-TINY: Target does not support the tiny CodeModel
69
710 define i32 @foo() nounwind readonly {
811 entry:
0
11 ; RUN: not llc < %s -march=xcore -code-model=medium 2>&1 | FileCheck %s -check-prefix=BAD_CM
22 ; RUN: not llc < %s -march=xcore -code-model=kernel 2>&1 | FileCheck %s -check-prefix=BAD_CM
3 ; RUN: not llc < %s -march=xcore -code-model=tiny 2>&1 | FileCheck %s -check-prefix=BAD_CM
34 ; BAD_CM: Target only supports CodeModel Small or Large
45
56