1 // Ensure we support the -mtune flag.
3 // cpu: "-target-cpu" "x86-64"
5 // Default mtune should be generic.
6 // RUN: %clang -### -c --target=x86_64 %s 2>&1 | FileCheck %s -check-prefix=generic
8 // RUN: %clang -### -c --target=x86_64 %s -mtune=generic 2>&1 | FileCheck %s --check-prefixes=cpu,generic
9 // generic: "-tune-cpu" "generic"
11 // RUN: %clang -### -c --target=x86_64 %s -mtune=nocona 2>&1 | FileCheck %s --check-prefixes=cpu,nocona
12 // nocona: "-tune-cpu" "nocona"
14 // Unlike march we allow 32-bit only cpus with mtune.
16 // RUN: %clang -### -c --target=x86_64 %s -mtune=i686 2>&1 | FileCheck %s --check-prefixes=cpu,i686
17 // i686: "-tune-cpu" "i686"
19 // RUN: %clang -### -c --target=x86_64 %s -mtune=pentium4 2>&1 | FileCheck %s -check-prefix=pentium4
20 // pentium4: "-tune-cpu" "pentium4"
22 // RUN: %clang -### -c --target=x86_64 %s -mtune=athlon 2>&1 | FileCheck %s -check-prefixes=cpu,athlon
23 // athlon: "-tune-cpu" "athlon"
25 // Check interaction between march and mtune.
27 // -march should remove default mtune generic.
28 // RUN: %clang -### -c --target=x86_64 %s -march=core2 2>&1 | FileCheck %s -check-prefix=marchcore2
29 // marchcore2: "-target-cpu" "core2"
30 // marchcore2-NOT: "-tune-cpu"
32 // -march should remove default mtune generic.
33 // RUN: %clang -### -c --target=x86_64 %s -march=core2 -mtune=nehalem 2>&1 | FileCheck %s -check-prefix=marchmtune
34 // marchmtune: "-target-cpu" "core2"
35 // mmarchmtune: "-tune-cpu" "nehalem"
37 // RUN: not %clang %s -target x86_64 -E -mtune=x86-64-v2 2>&1 | FileCheck %s --check-prefix=INVALID
38 // RUN: not %clang %s -target x86_64 -E -mtune=x86-64-v3 2>&1 | FileCheck %s --check-prefix=INVALID
39 // RUN: not %clang %s -target x86_64 -E -mtune=x86-64-v4 2>&1 | FileCheck %s --check-prefix=INVALID
40 // INVALID: error: unknown target CPU '{{.*}}'