summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2014-11-14 22:09:15 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2014-11-14 22:09:15 +0000
commit5f951ee8bd723d5fcfeacf6d79b4ebf074069f85 (patch)
treeaa5abbcc170b2a7be5446a677f65d6483edc18c4 /clang/test
parentd38341e9425599d0d1e80310cd9da97e2da1d708 (diff)
downloadbcm5719-llvm-5f951ee8bd723d5fcfeacf6d79b4ebf074069f85.tar.gz
bcm5719-llvm-5f951ee8bd723d5fcfeacf6d79b4ebf074069f85.zip
Recommit r222044 with a test fix - it does not make sense to hunt
for a typedef before arithmetic conversion in all rare corner cases. llvm-svn: 222049
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGen/complex.c16
-rw-r--r--clang/test/SemaObjC/format-strings-objc.m2
2 files changed, 17 insertions, 1 deletions
diff --git a/clang/test/CodeGen/complex.c b/clang/test/CodeGen/complex.c
index 206db253caa..1c0e7cb2ee9 100644
--- a/clang/test/CodeGen/complex.c
+++ b/clang/test/CodeGen/complex.c
@@ -98,3 +98,19 @@ void t8() {
const _Complex double test9const = 0;
_Complex double test9func() { return test9const; }
+
+// D6217
+void t91() {
+ // Check for proper type promotion of conditional expression
+ char c[(int)(sizeof(typeof((0 ? 2.0f : (_Complex double) 2.0f))) - sizeof(_Complex double))];
+ // Check for proper codegen
+ (0 ? 2.0f : (_Complex double) 2.0f);
+}
+
+void t92() {
+ // Check for proper type promotion of conditional expression
+ char c[(int)(sizeof(typeof((0 ? (_Complex double) 2.0f : 2.0f))) - sizeof(_Complex double))];
+ // Check for proper codegen
+ (0 ? (_Complex double) 2.0f : 2.0f);
+}
+
diff --git a/clang/test/SemaObjC/format-strings-objc.m b/clang/test/SemaObjC/format-strings-objc.m
index 49567a710c3..f4c528cc7ac 100644
--- a/clang/test/SemaObjC/format-strings-objc.m
+++ b/clang/test/SemaObjC/format-strings-objc.m
@@ -243,7 +243,7 @@ void testByValueObjectInFormat(Foo *obj) {
// <rdar://problem/13557053>
void testTypeOf(NSInteger dW, NSInteger dH) {
- NSLog(@"dW %d dH %d",({ __typeof__(dW) __a = (dW); __a < 0 ? -__a : __a; }),({ __typeof__(dH) __a = (dH); __a < 0 ? -__a : __a; })); // expected-warning 2 {{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}}
+ NSLog(@"dW %d dH %d",({ __typeof__(dW) __a = (dW); __a < 0 ? -__a : __a; }),({ __typeof__(dH) __a = (dH); __a < 0 ? -__a : __a; })); // expected-warning 2 {{format specifies type 'int' but the argument has type 'long'}}
}
void testUnicode() {
OpenPOWER on IntegriCloud