Skip to content

Commit 390e50c

Browse files
committed
Added thumb to supported platforms conditions
1 parent f3aa9f4 commit 390e50c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

lib/Basic/LangOptions.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ std::pair<bool, bool> LangOptions::setTarget(llvm::Triple triple) {
117117
// Set the "arch" platform condition.
118118
switch (Target.getArch()) {
119119
case llvm::Triple::ArchType::arm:
120+
case llvm::Triple::ArchType::thumb:
120121
addPlatformConditionValue("arch", "arm");
121122
break;
122123
case llvm::Triple::ArchType::aarch64:

test/Driver/linker.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
// RUN: %swiftc_driver -driver-print-jobs -target armv7-unknown-linux-gnueabihf -Ffoo -framework bar -Lbaz -lboo -Xlinker -undefined %s 2>&1 > %t.linux.txt
2121
// RUN: FileCheck -check-prefix LINUX-armv7 %s < %t.linux.txt
2222

23+
// RUN: %swiftc_driver -driver-print-jobs -target thumbv7-unknown-linux-gnueabihf -Ffoo -framework bar -Lbaz -lboo -Xlinker -undefined %s 2>&1 > %t.linux.txt
24+
// RUN: FileCheck -check-prefix LINUX-thumbv7 %s < %t.linux.txt
25+
2326
// RUN: %swiftc_driver -driver-print-jobs -emit-library -target x86_64-apple-macosx10.9.1 %s -sdk %S/../Inputs/clang-importer-sdk -lfoo -framework bar -Lbaz -Fgarply -Xlinker -undefined -Xlinker dynamic_lookup -o sdk.out 2>&1 > %t.complex.txt
2427
// RUN: FileCheck %s < %t.complex.txt
2528
// RUN: FileCheck -check-prefix COMPLEX %s < %t.complex.txt
@@ -147,6 +150,22 @@
147150
// LINUX-armv7-DAG: -Xlinker -undefined
148151
// LINUX-armv7: -o linker
149152

153+
// LINUX-thumbv7: swift
154+
// LINUX-thumbv7: -o [[OBJECTFILE:.*]]
155+
156+
// LINUX-thumbv7: clang++{{"? }}
157+
// LINUX-thumbv7-DAG: [[OBJECTFILE]]
158+
// LINUX-thumbv7-DAG: -lswiftCore
159+
// LINUX-thumbv7-DAG: -L [[STDLIB_PATH:[^ ]+/lib/swift]]
160+
// LINUX-thumbv7-DAG: --target=thumbv7-unknown-linux-gnueabihf
161+
// LINUX-thumbv7-DAG: -Xlinker -rpath -Xlinker [[STDLIB_PATH]]
162+
// LINUX-thumbv7-DAG: -F foo
163+
// LINUX-thumbv7-DAG: -framework bar
164+
// LINUX-thumbv7-DAG: -L baz
165+
// LINUX-thumbv7-DAG: -lboo
166+
// LINUX-thumbv7-DAG: -Xlinker -undefined
167+
// LINUX-thumbv7: -o linker
168+
150169
// COMPLEX: bin/ld{{"? }}
151170
// COMPLEX-DAG: -dylib
152171
// COMPLEX-DAG: -syslibroot {{.*}}/Inputs/clang-importer-sdk

0 commit comments

Comments
 (0)