]> granicus.if.org Git - clang/commit
Fix PR16454: Don't #include altivec.h when preprocessing assembly.
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Wed, 3 Jul 2013 15:36:02 +0000 (15:36 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Wed, 3 Jul 2013 15:36:02 +0000 (15:36 +0000)
commit9e0b647bccb9e22936e1dacbe33ec7f941764d87
tree746a8a533eb8c4dfab2ef1d29df4d10c66bd6e61
parent9c4e77075c62c9edf2fbb7a22039c6ff889fa4fc
Fix PR16454: Don't #include altivec.h when preprocessing assembly.

When the -maltivec flag is present, altivec.h is auto-included for the
compilation.  This is not appropriate when the job action is to
preprocess a file containing assembly code.  So don't do that.

I was unable to convert the test in the bug report into a regression
test.  The original symptom was exposed with:

  % touch x.S
  % ./bin/clang -target powerpc64-unknown-linux-gnu -maltivec -S -o - x.S

I tried this test (and numerous variants) on a PPC64 system:

----------------------------------------------------------------------------
// RUN: touch %t
// RUN: %clang -maltivec -S %t -o - | FileCheck %s

// Verify that assembling an empty file does not auto-include altivec.h.

// CHECK-NOT: static vector
----------------------------------------------------------------------------

However, this test passes for some reason even on a clang built
without the fix.  I'd be happy to add a test case but at this point
I'm not able to figure one out, and I don't want to hold up the patch
unnecessarily.  Please let me know if you have ideas.

Thanks,
Bill

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185544 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Driver/Tools.cpp