forked from OSchip/llvm-project
Only override the target architecture on -m32 and friends if it is
actually different. Fixes a surprising link error with nodejs on rpi, where armv6-netbsd-eabihf turned into armv5e-netbsd-eabihf, which doesn't lacks the necessary VFP support. llvm-svn: 217546
This commit is contained in:
parent
8123630a21
commit
b7e0ac6253
|
@ -1947,7 +1947,7 @@ static llvm::Triple computeTargetTriple(StringRef DefaultTargetTriple,
|
|||
Target.setEnvironment(llvm::Triple::CODE16);
|
||||
}
|
||||
|
||||
if (AT != llvm::Triple::UnknownArch)
|
||||
if (AT != llvm::Triple::UnknownArch && AT != Target.getArch())
|
||||
Target.setArch(AT);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
// RUN: %clang -target i386--netbsd -m32 %s -### 2> %t
|
||||
// RUN: grep '"-cc1" "-triple" "i386--netbsd"' %t
|
||||
|
||||
// RUN: %clang -target i386--netbsd -m64 %s -### 2> %t
|
||||
// RUN: grep '"-cc1" "-triple" "x86_64--netbsd"' %t
|
||||
|
||||
// RUN: %clang -target x86_64--netbsd -m32 %s -### 2> %t
|
||||
// RUN: grep '"-cc1" "-triple" "i386--netbsd"' %t
|
||||
|
||||
// RUN: %clang -target x86_64--netbsd -m64 %s -### 2> %t
|
||||
// RUN: grep '"-cc1" "-triple" "x86_64--netbsd"' %t
|
||||
|
||||
// RUN: %clang -target armv6--netbsd-eabihf -m32 %s -### 2> %t
|
||||
// RUN: grep '"-cc1" "-triple" "armv6--netbsd-eabihf"' %t
|
||||
|
||||
// RUN: %clang -target sparcv9--netbsd -m32 %s -### 2> %t
|
||||
// RUN: grep '"-cc1" "-triple" "sparc--netbsd"' %t
|
||||
|
||||
// RUN: %clang -target sparcv9--netbsd -m64 %s -### 2> %t
|
||||
// RUN: grep '"-cc1" "-triple" "sparcv9--netbsd"' %t
|
||||
|
||||
// RUN: %clang -target sparc64--netbsd -m64 %s -### 2> %t
|
||||
// RUN: grep '"-cc1" "-triple" "sparc64--netbsd"' %t
|
||||
|
||||
// RUN: %clang -target sparc--netbsd -m32 %s -### 2> %t
|
||||
// RUN: grep '"-cc1" "-triple" "sparc--netbsd"' %t
|
||||
|
||||
// RUN: %clang -target sparc--netbsd -m64 %s -### 2> %t
|
||||
// RUN: grep '"-cc1" "-triple" "sparcv9--netbsd"' %t
|
||||
|
||||
// RUN: %clang -target mips64--netbsd -m32 %s -### 2> %t
|
||||
// RUN: grep '"-cc1" "-triple" "mips--netbsd"' %t
|
||||
|
||||
// RUN: %clang -target mips64--netbsd -m64 %s -### 2> %t
|
||||
// RUN: grep '"-cc1" "-triple" "mips64--netbsd"' %t
|
||||
|
||||
// RUN: %clang -target mips--netbsd -m32 %s -### 2> %t
|
||||
// RUN: grep '"-cc1" "-triple" "mips--netbsd"' %t
|
||||
|
||||
// RUN: %clang -target mips--netbsd -m64 %s -### 2> %t
|
||||
// RUN: grep '"-cc1" "-triple" "mips64--netbsd"' %t
|
Loading…
Reference in New Issue