1/// These tests make sure that options passed to the assembler
2/// via -Wa or -Xassembler are applied correctly to assembler inputs.
3
4/// Does not apply to non assembly files
5// RUN: %clang --target=aarch64-linux-gnueabi -### -c -Wa,-march=armv8.1-a \
6// RUN: %S/Inputs/wildcard1.c 2>&1 | FileCheck --check-prefix=TARGET-FEATURE-1 %s
7// RUN: %clang --target=aarch64-linux-gnueabi -### -c -Xassembler -march=armv8.1-a \
8// RUN: %S/Inputs/wildcard1.c 2>&1 | FileCheck --check-prefix=TARGET-FEATURE-1 %s
9
10// TARGET-FEATURE-1-NOT: "-target-feature" "+v8.1a"
11
12/// Does apply to assembler input
13// RUN: %clang --target=aarch64-linux-gnueabi -### -c -Wa,-march=armv8.2-a %s 2>&1 | \
14// RUN: FileCheck --check-prefix=TARGET-FEATURE-2 %s
15// RUN: %clang --target=aarch64-linux-gnueabi -### -c -Xassembler -march=armv8.2-a %s 2>&1 | \
16// RUN: FileCheck --check-prefix=TARGET-FEATURE-2 %s
17
18// TARGET-FEATURE-2: "-target-feature" "+v8.2a"
19
20/// No unused argument warnings when there are multiple values
21// RUN: %clang --target=aarch64-linux-gnueabi -### -c -Wa,-march=armv8.1-a -Wa,-march=armv8.2-a %s 2>&1 | \
22// RUN: FileCheck --check-prefix=UNUSED-WARNING %s
23
24// UNUSED-WARNING-NOT: warning: argument unused during compilation
25
26/// Last march to assembler wins
27// RUN: %clang --target=aarch64-linux-gnueabi -### -c -Wa,-march=armv8.2-a -Wa,-march=armv8.1-a %s 2>&1 | \
28// RUN: FileCheck --check-prefix=MULTIPLE-VALUES %s
29// RUN: %clang --target=aarch64-linux-gnueabi -### -c -Wa,-march=armv8.2-a,-march=armv8.1-a %s 2>&1 | \
30// RUN: FileCheck --check-prefix=MULTIPLE-VALUES %s
31// RUN: %clang --target=aarch64-linux-gnueabi -### -c -Xassembler -march=armv8.2-a -Xassembler \
32// RUN: -march=armv8.1-a %s 2>&1 | FileCheck --check-prefix=MULTIPLE-VALUES %s
33
34// MULTIPLE-VALUES: "-target-feature" "+v8.1a
35// MULTIPLE-VALUES-NOT: "-target-feature" "+v8.2a
36
37/// march to compiler and assembler, we choose the one suited to the input file type
38// RUN: %clang --target=aarch64-linux-gnueabi -### -c -Wa,-march=armv8.3-a -march=armv8.4-a %s 2>&1 | \
39// RUN: FileCheck --check-prefix=TARGET-FEATURE-3 %s
40// RUN: %clang --target=aarch64-linux-gnueabi -### -c -Wa,-march=armv8.3-a -march=armv8.4-a \
41// RUN: %S/Inputs/wildcard1.c 2>&1 | FileCheck --check-prefix=TARGET-FEATURE-4 %s
42
43// TARGET-FEATURE-3: "-target-feature" "+v8.3a"
44// TARGET-FEATURE-3-NOT: "-target-feature" "+v8.4a"
45// TARGET-FEATURE-4: "-target-feature" "+v8.4a"
46// TARGET-FEATURE-4-NOT: "-target-feature" "+v8.3a"
47