Clang Project

clang_source_code/test/Driver/unsupported-target-arch.c
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', please use -triple or -arch
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{{.+}}', please use -triple or -arch
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-{{.+}}', please use -triple or -arch
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', please use -triple or -arch
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', please use -triple or -arch
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