diff options
Diffstat (limited to 'test/Sema/conversion-64-32.c')
-rw-r--r-- | test/Sema/conversion-64-32.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Sema/conversion-64-32.c b/test/Sema/conversion-64-32.c index 112e995102..62db7dcd2e 100644 --- a/test/Sema/conversion-64-32.c +++ b/test/Sema/conversion-64-32.c @@ -13,3 +13,23 @@ int4 test1(long2 a) { int4 v127 = a; // no warning. return v127; } + +// <rdar://problem/10759934> +// Don't warn about -Wshorten-64-to-32 in unreachable code. +typedef unsigned int uint32_t; +typedef unsigned long long uint64_t; +int rdar10759934() { + uint32_t thing = 0; + uint64_t thing2 = 0; + + switch (sizeof(thing2)) { + case 8: + break; + case 4: + thing = thing2; // no-warning + default: + break; + } + + return 0; +} |