| 1 |
// Ensure we support the -mtune flag. |
| 2 |
|
| 3 |
// cpu: "-target-cpu" "x86-64" |
| 4 |
|
| 5 |
// Default mtune should be generic. |
| 6 |
// RUN: %clang -### -c --target=x86_64 %s 2>&1 | FileCheck %s -check-prefix=generic |
| 7 |
|
| 8 |
// RUN: %clang -### -c --target=x86_64 %s -mtune=generic 2>&1 | FileCheck %s --check-prefixes=cpu,generic |
| 9 |
// generic: "-tune-cpu" "generic" |
| 10 |
|
| 11 |
// RUN: %clang -### -c --target=x86_64 %s -mtune=nocona 2>&1 | FileCheck %s --check-prefixes=cpu,nocona |
| 12 |
// nocona: "-tune-cpu" "nocona" |
| 13 |
|
| 14 |
// Unlike march we allow 32-bit only cpus with mtune. |
| 15 |
|
| 16 |
// RUN: %clang -### -c --target=x86_64 %s -mtune=i686 2>&1 | FileCheck %s --check-prefixes=cpu,i686 |
| 17 |
// i686: "-tune-cpu" "i686" |
| 18 |
|
| 19 |
// RUN: %clang -### -c --target=x86_64 %s -mtune=pentium4 2>&1 | FileCheck %s -check-prefix=pentium4 |
| 20 |
// pentium4: "-tune-cpu" "pentium4" |
| 21 |
|
| 22 |
// RUN: %clang -### -c --target=x86_64 %s -mtune=athlon 2>&1 | FileCheck %s -check-prefixes=cpu,athlon |
| 23 |
// athlon: "-tune-cpu" "athlon" |
| 24 |
|
| 25 |
// Check interaction between march and mtune. |
| 26 |
|
| 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" |
| 31 |
|
| 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" |
| 36 |
|
| 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 '{{.*}}' |