summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-11-15 01:21:59 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-11-15 01:21:59 +0000
commit6745c3b732d1013b2c9aca55ec5ed028528a00eb (patch)
tree8e4e419193040537a82fa83d1ddfa15c347d5af9
parentb634bc91b4b5d36b94538338ee58d7357ad16b75 (diff)
downloadbcm5719-llvm-6745c3b732d1013b2c9aca55ec5ed028528a00eb.tar.gz
bcm5719-llvm-6745c3b732d1013b2c9aca55ec5ed028528a00eb.zip
Fix a trivial bool-related bug I spotted while skimming David Fang's
current list of powerpc-darwin8 failures. llvm-svn: 168016
-rw-r--r--clang/lib/AST/ASTContext.cpp4
-rw-r--r--clang/test/Sema/ppc-bool.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index d5107b07c0d..c192d288602 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -4153,8 +4153,8 @@ QualType ASTContext::getPromotedIntegerType(QualType Promotable) const {
// At this point, we should have a signed or unsigned integer type.
if (Promotable->isSignedIntegerType())
return IntTy;
- uint64_t PromotableSize = getTypeSize(Promotable);
- uint64_t IntSize = getTypeSize(IntTy);
+ uint64_t PromotableSize = getIntWidth(Promotable);
+ uint64_t IntSize = getIntWidth(IntTy);
assert(Promotable->isUnsignedIntegerType() && PromotableSize <= IntSize);
return (PromotableSize != IntSize) ? IntTy : UnsignedIntTy;
}
diff --git a/clang/test/Sema/ppc-bool.c b/clang/test/Sema/ppc-bool.c
new file mode 100644
index 00000000000..2a4303eb1d9
--- /dev/null
+++ b/clang/test/Sema/ppc-bool.c
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -triple powerpc-apple-macosx10.4.0 -verify -fsyntax-only %s
+// expected-no-diagnostics
+extern __typeof(+(_Bool)0) should_be_int;
+extern int should_be_int;
OpenPOWER on IntegriCloud