[X86] Add mtune command line test cases that should have gone with 4cbceb74bb5676d018...
authorCraig Topper <craig.topper@intel.com>
Wed, 19 Aug 2020 22:58:06 +0000 (15:58 -0700)
committerCraig Topper <craig.topper@intel.com>
Wed, 19 Aug 2020 22:58:06 +0000 (15:58 -0700)
clang/test/CodeGen/tune-cpu.c [new file with mode: 0644]
clang/test/Driver/x86-mtune.c [new file with mode: 0644]

diff --git a/clang/test/CodeGen/tune-cpu.c b/clang/test/CodeGen/tune-cpu.c
new file mode 100644 (file)
index 0000000..60c2c30
--- /dev/null
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -triple i686-linux-gnu -target-cpu i686 -tune-cpu nehalem -emit-llvm %s -o - | FileCheck %s
+
+int baz(int a) { return 4; }
+
+// CHECK: baz{{.*}} #0
+// CHECK: #0 = {{.*}}"target-cpu"="i686" "target-features"="+cx8,+x87" "tune-cpu"="nehalem"
diff --git a/clang/test/Driver/x86-mtune.c b/clang/test/Driver/x86-mtune.c
new file mode 100644 (file)
index 0000000..65ac1a5
--- /dev/null
@@ -0,0 +1,5 @@
+// Ensure we support the -mtune flag.
+//
+// RUN: %clang -target x86_64-unknown-unknown -c -### %s -mtune=nocona 2>&1 \
+// RUN:   | FileCheck %s -check-prefix=nocona
+// nocona: "-tune-cpu" "nocona"