pengfei updated this revision to Diff 504401. pengfei added a comment. Fix lit failure.
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145857/new/ https://reviews.llvm.org/D145857 Files: clang/lib/Driver/ToolChains/Arch/X86.cpp clang/test/Driver/cl-x86-flags.c clang/test/Driver/nacl-direct.c Index: clang/test/Driver/nacl-direct.c =================================================================== --- clang/test/Driver/nacl-direct.c +++ clang/test/Driver/nacl-direct.c @@ -6,7 +6,7 @@ // RUN: | FileCheck --check-prefix=CHECK-I686 %s // CHECK-I686: "-cc1" // CHECK-I686-NOT: "-fno-use-init-array" -// CHECK-I686: "-target-cpu" "pentium4" +// CHECK-I686: "-target-cpu" "i686" // CHECK-I686: "-resource-dir" "foo" // CHECK-I686: "-internal-isystem" "foo{{/|\\\\}}include" // CHECK-I686: "-internal-isystem" "{{.*}}{{/|\\\\}}..{{/|\\\\}}i686-nacl{{/|\\\\}}usr{{/|\\\\}}include" Index: clang/test/Driver/cl-x86-flags.c =================================================================== --- clang/test/Driver/cl-x86-flags.c +++ clang/test/Driver/cl-x86-flags.c @@ -133,5 +133,11 @@ // tune: "-target-cpu" "sandybridge" // tune-SAME: "-tune-cpu" "haswell" +// RUN: %clang_cl --target=i686-unknown-unknown -### -- 2>&1 %s | FileCheck -check-prefix=i686 %s +// i686: "-target-cpu" "i686" + +// RUN: %clang_cl --target=i786-unknown-unknown -### -- 2>&1 %s | FileCheck -check-prefix=i786 %s +// i786: "-target-cpu" "pentiumpro" + void f(void) { } Index: clang/lib/Driver/ToolChains/Arch/X86.cpp =================================================================== --- clang/lib/Driver/ToolChains/Arch/X86.cpp +++ clang/lib/Driver/ToolChains/Arch/X86.cpp @@ -102,6 +102,12 @@ if (Is64Bit) return "x86-64"; + if (Triple.getArchName() == "i686") + return "i686"; + + if (Triple.getArchName() == "i786") + return "pentiumpro"; + switch (Triple.getOS()) { case llvm::Triple::NetBSD: return "i486";
Index: clang/test/Driver/nacl-direct.c =================================================================== --- clang/test/Driver/nacl-direct.c +++ clang/test/Driver/nacl-direct.c @@ -6,7 +6,7 @@ // RUN: | FileCheck --check-prefix=CHECK-I686 %s // CHECK-I686: "-cc1" // CHECK-I686-NOT: "-fno-use-init-array" -// CHECK-I686: "-target-cpu" "pentium4" +// CHECK-I686: "-target-cpu" "i686" // CHECK-I686: "-resource-dir" "foo" // CHECK-I686: "-internal-isystem" "foo{{/|\\\\}}include" // CHECK-I686: "-internal-isystem" "{{.*}}{{/|\\\\}}..{{/|\\\\}}i686-nacl{{/|\\\\}}usr{{/|\\\\}}include" Index: clang/test/Driver/cl-x86-flags.c =================================================================== --- clang/test/Driver/cl-x86-flags.c +++ clang/test/Driver/cl-x86-flags.c @@ -133,5 +133,11 @@ // tune: "-target-cpu" "sandybridge" // tune-SAME: "-tune-cpu" "haswell" +// RUN: %clang_cl --target=i686-unknown-unknown -### -- 2>&1 %s | FileCheck -check-prefix=i686 %s +// i686: "-target-cpu" "i686" + +// RUN: %clang_cl --target=i786-unknown-unknown -### -- 2>&1 %s | FileCheck -check-prefix=i786 %s +// i786: "-target-cpu" "pentiumpro" + void f(void) { } Index: clang/lib/Driver/ToolChains/Arch/X86.cpp =================================================================== --- clang/lib/Driver/ToolChains/Arch/X86.cpp +++ clang/lib/Driver/ToolChains/Arch/X86.cpp @@ -102,6 +102,12 @@ if (Is64Bit) return "x86-64"; + if (Triple.getArchName() == "i686") + return "i686"; + + if (Triple.getArchName() == "i786") + return "pentiumpro"; + switch (Triple.getOS()) { case llvm::Triple::NetBSD: return "i486";
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits