diff options
author | John McCall <rjmccall@apple.com> | 2010-02-24 07:14:12 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-02-24 07:14:12 +0000 |
commit | 8ee376f08ae11a8a79a9d8d6b36de12ad3b12869 (patch) | |
tree | 1b344eae714e87c6d15c02cdc9bbcd1f12de66ce /clang/test | |
parent | e7327435a7f8336afb7db9022a5e7fbee8d67825 (diff) | |
download | bcm5719-llvm-8ee376f08ae11a8a79a9d8d6b36de12ad3b12869.tar.gz bcm5719-llvm-8ee376f08ae11a8a79a9d8d6b36de12ad3b12869.zip |
Canonicalize parameter and return types before computing ABI info. Eliminates
a common source of oddities and, in theory, removes some redundant ABI
computations. Also fixes a miscompile I introduced yesterday by refactoring
some code and causing a slightly different code path to be taken that
didn't perform *parameter* type canonicalization, just normal type
canonicalization; this in turn caused a bit of ABI code to misfire because
it was looking for 'double' or 'float' but received 'const float'.
llvm-svn: 97030
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CodeGen/functions.c | 11 | ||||
-rw-r--r-- | clang/test/CodeGenObjC/messages-2.m | 3 |
2 files changed, 13 insertions, 1 deletions
diff --git a/clang/test/CodeGen/functions.c b/clang/test/CodeGen/functions.c index cb9a4ef81f1..d9c87d53edb 100644 --- a/clang/test/CodeGen/functions.c +++ b/clang/test/CodeGen/functions.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o %t +// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s int g(); @@ -38,3 +38,12 @@ struct foo { int X, Y, Z; } f3() { // PR4423 - This shouldn't crash in codegen void f4() {} void f5() { f4(42); } + +// Qualifiers on parameter types shouldn't make a difference. +static void f6(const float f, const float g) { +} +void f7(float f, float g) { + f6(f, g); +// CHECK: define void @f7(float{{.*}}, float{{.*}}) +// CHECK: call void @f6(float{{.*}}, float{{.*}}) +} diff --git a/clang/test/CodeGenObjC/messages-2.m b/clang/test/CodeGenObjC/messages-2.m index 2a6e3dcbbda..05e30ab131a 100644 --- a/clang/test/CodeGenObjC/messages-2.m +++ b/clang/test/CodeGenObjC/messages-2.m @@ -136,4 +136,7 @@ typedef struct { x.height *= 2; return x; } +-(const float) returnAConstFloat { + return 5; +} @end |