r177496 - Fix redundant comparison in gcc::Common::ConstructJob.
Hans Wennborg
hans at hanshq.net
Wed Mar 20 00:34:28 PDT 2013
Author: hans
Date: Wed Mar 20 02:34:27 2013
New Revision: 177496
URL: http://llvm.org/viewvc/llvm-project?rev=177496&view=rev
Log:
Fix redundant comparison in gcc::Common::ConstructJob.
We were checking "Arch == llvm::Triple::x86_64 || Arch
== llvm::Triple::x86_64", but the rhs should actually check for
powerpc64.
Found while experimenting with a potential new Clang warning.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/unknown-gcc-arch.c
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=177496&r1=177495&r2=177496&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Mar 20 02:34:27 2013
@@ -3631,7 +3631,7 @@ void gcc::Common::ConstructJob(Compilati
// here.
if (Arch == llvm::Triple::x86 || Arch == llvm::Triple::ppc)
CmdArgs.push_back("-m32");
- else if (Arch == llvm::Triple::x86_64 || Arch == llvm::Triple::x86_64)
+ else if (Arch == llvm::Triple::x86_64 || Arch == llvm::Triple::ppc64)
CmdArgs.push_back("-m64");
if (Output.isFilename()) {
Modified: cfe/trunk/test/Driver/unknown-gcc-arch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/unknown-gcc-arch.c?rev=177496&r1=177495&r2=177496&view=diff
==============================================================================
--- cfe/trunk/test/Driver/unknown-gcc-arch.c (original)
+++ cfe/trunk/test/Driver/unknown-gcc-arch.c Wed Mar 20 02:34:27 2013
@@ -1,8 +1,32 @@
-// RUN: %clang -target x86_64-unknown-unknown -c -x assembler %s -### 2> %t.log
-// RUN: grep '.*gcc.*"-m64"' %t.log
-// RUN: %clang -target x86_64-unknown-unknown -c -x assembler %s -### -m32 2> %t.log
-// RUN: grep '.*gcc.*"-m32"' %t.log
-// RUN: %clang -target i386-unknown-unknown -c -x assembler %s -### 2> %t.log
-// RUN: grep '.*gcc.*"-m32"' %t.log
-// RUN: %clang -target i386-unknown-unknown -c -x assembler %s -### -m64 2> %t.log
-// RUN: grep '.*gcc.*"-m64"' %t.log
+// RUN: %clang -target x86_64-unknown-unknown -c -x assembler %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=X86_64 %s
+// X86_64: {{.*gcc.*-m64}}
+
+// RUN: %clang -target x86_64-unknown-unknown -c -x assembler %s -### -m32 2>&1 \
+// RUN: | FileCheck -check-prefix=X86_64-M32 %s
+// X86_64-M32: {{.*gcc.*-m32}}
+
+// RUN: %clang -target i386-unknown-unknown -c -x assembler %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=I386 %s
+// I386: {{.*gcc.*-m32}}
+
+// RUN: %clang -target i386-unknown-unknown -c -x assembler %s -### -m64 2>&1 \
+// RUN: | FileCheck -check-prefix=I386-M64 %s
+// I386-M64: {{.*gcc.*-m64}}
+
+
+// RUN: %clang -target powerpc64-unknown-unknown -c -x assembler %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=PPC64 %s
+// PPC64: {{.*gcc.*-m64}}
+
+// RUN: %clang -target powerpc64-unknown-unknown -c -x assembler %s -### -m32 2>&1 \
+// RUN: | FileCheck -check-prefix=PPC64-M32 %s
+// PPC64-M32: {{.*gcc.*-m32}}
+
+// RUN: %clang -target powerpc-unknown-unknown -c -x assembler %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=PPC %s
+// PPC: {{.*gcc.*-m32}}
+
+// RUN: %clang -target powerpc-unknown-unknown -c -x assembler %s -### -m64 2>&1 \
+// RUN: | FileCheck -check-prefix=PPC-M64 %s
+// PPC-M64: {{.*gcc.*-m64}}
More information about the cfe-commits
mailing list