1 // Tests that clang does not crash with invalid architectures in target triples. 2 // 3 // RUN: not %clang --target=noarch-unknown-linux -o %t.o %s 2> %t.err 4 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-NOARCH-LINUX %s 5 // CHECK-NOARCH-LINUX: error: unknown target triple 'noarch-unknown-linux'{{$}} 6 // 7 // RUN: not %clang --target=noarch-unknown-darwin -o %t.o %s 2> %t.err 8 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-NOARCH-DARWIN %s 9 // CHECK-NOARCH-DARWIN: error: unknown target triple 'unknown-unknown-macosx{{.+}}'{{$}} 10 // 11 // RUN: not %clang --target=noarch-unknown-windows -o %t.o %s 2> %t.err 12 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-NOARCH-WINDOWS %s 13 // CHECK-NOARCH-WINDOWS: error: unknown target triple 'noarch-unknown-windows-{{.+}}'{{$}} 14 // 15 // RUN: not %clang --target=noarch-unknown-freebsd -o %t.o %s 2> %t.err 16 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-NOARCH-FREEBSD %s 17 // CHECK-NOARCH-FREEBSD: error: unknown target triple 'noarch-unknown-freebsd'{{$}} 18 // 19 // RUN: not %clang --target=noarch-unknown-netbsd -o %t.o %s 2> %t.err 20 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-NOARCH-NETBSD %s 21 // CHECK-NOARCH-NETBSD: error: unknown target triple 'noarch-unknown-netbsd'{{$}} 22 // 23 // RUN: not %clang --target=noarch-unknown-nacl -o %t.o %s 2> %t.err 24 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-NOARCH-NACL %s 25 // CHECK-NOARCH-NACL: error: the target architecture 'noarch' is not supported by the target 'Native Client' 26 27 // RUN: not %clang --target=noarch-unknown-windows-gnu -o %t.o %s 2> %t.err 28 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-NOARCH-MINGW %s 29 // CHECK-NOARCH-MINGW: error: unknown target triple 'noarch-unknown-windows-gnu' 30 31 // RUN: not %clang --target=noarch-unknown-windows-itanium -o %t.o %s 2> %t.err 32 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-NOARCH-CROSSWINDOWS %s 33 // CHECK-NOARCH-CROSSWINDOWS: error: unknown target triple 'noarch-unknown-windows-itanium' 34 35 // RUN: not %clang --target=aarch64-none-eabi -o %t.o %s 2> %t.err 36 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-AARCH64-INVALID-ENV %s 37 // CHECK-AARCH64-INVALID-ENV: warning: mismatch between architecture and environment in target triple 'aarch64-none-eabi'; did you mean 'aarch64-none-elf'? [-Winvalid-command-line-argument]{{$}} 38 39 // RUN: not %clang --target=aarch64_be-none-eabihf -o %t.o %s 2> %t.err 40 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-AARCH64_BE-INVALID-ENV %s 41 // CHECK-AARCH64_BE-INVALID-ENV: warning: mismatch between architecture and environment in target triple 'aarch64_be-none-eabihf'; did you mean 'aarch64_be-none-elf'? [-Winvalid-command-line-argument]{{$}} 42 43 // RUN: not %clang --target=aarch64_32-none-eabi -o %t.o %s 2> %t.err 44 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-AARCH64_32-INVALID-ENV %s 45 // CHECK-AARCH64_32-INVALID-ENV: warning: mismatch between architecture and environment in target triple 'aarch64_32-none-eabi'; did you mean 'aarch64_32-none-elf'? [-Winvalid-command-line-argument]{{$}} 46 47 // RUN: not %clang --target=arm-none-elf -o %t.o %s 2> %t.err 48 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-ARM-INVALID-ENV %s 49 // CHECK-ARM-INVALID-ENV: warning: mismatch between architecture and environment in target triple 'arm-none-elf'; did you mean 'arm-none-eabi'? [-Winvalid-command-line-argument]{{$}} 50 51 // RUN: not %clang --target=armeb-none-elf -o %t.o %s 2> %t.err 52 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-ARMEB-INVALID-ENV %s 53 // CHECK-ARMEB-INVALID-ENV: warning: mismatch between architecture and environment in target triple 'armeb-none-elf'; did you mean 'armeb-none-eabi'? [-Winvalid-command-line-argument]{{$}} 54 55 // RUN: not %clang --target=thumbv6m-none-elf -o %t.o %s 2> %t.err 56 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-THUMB-INVALID-ENV %s 57 // CHECK-THUMB-INVALID-ENV: warning: mismatch between architecture and environment in target triple 'thumbv6m-none-elf'; did you mean 'thumbv6m-none-eabi'? [-Winvalid-command-line-argument]{{$}} 58 59 // RUN: not %clang --target=thumbeb-none-elf -o %t.o %s 2> %t.err 60 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-THUMBEB-INVALID-ENV %s 61 // CHECK-THUMBEB-INVALID-ENV: warning: mismatch between architecture and environment in target triple 'thumbeb-none-elf'; did you mean 'thumbeb-none-eabi'? [-Winvalid-command-line-argument]{{$}} 62 63 // RUN: not %clang --target=powerpc-apple-darwin -o /dev/null %s 2> %t.err 64 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-PPCMAC %s 65 // CHECK-PPCMAC: error: unknown target triple 'unknown-apple-macosx{{.*}}' 66