diff options
author | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
commit | 39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df (patch) | |
tree | a9243275843fbeaa590afc07ee888e006b8d54ea /test/Sema/cast.c | |
parent | 69b4eca4a4255ba43baa5c1d9bbdec3ec17f479e (diff) | |
download | FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.zip FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.tar.gz |
Vendor import of clang trunk r126079:
http://llvm.org/svn/llvm-project/cfe/trunk@126079
Diffstat (limited to 'test/Sema/cast.c')
-rw-r--r-- | test/Sema/cast.c | 141 |
1 files changed, 141 insertions, 0 deletions
diff --git a/test/Sema/cast.c b/test/Sema/cast.c index e52dcae..71c44b4 100644 --- a/test/Sema/cast.c +++ b/test/Sema/cast.c @@ -16,3 +16,144 @@ long bar1(long *next) { return (long)(*next)++; } +typedef _Bool Bool; +typedef int Int; +typedef long Long; +typedef float Float; +typedef double Double; +typedef _Complex int CInt; +typedef _Complex long CLong; +typedef _Complex float CFloat; +typedef _Complex double CDouble; +typedef void *VoidPtr; +typedef char *CharPtr; + +void testBool(Bool v) { + (void) (Bool) v; + (void) (Int) v; + (void) (Long) v; + (void) (Float) v; + (void) (Double) v; + (void) (CInt) v; + (void) (CLong) v; + (void) (CFloat) v; + (void) (CDouble) v; + (void) (VoidPtr) v; + (void) (CharPtr) v; +} + +void testInt(Int v) { + (void) (Bool) v; + (void) (Int) v; + (void) (Long) v; + (void) (Float) v; + (void) (Double) v; + (void) (CInt) v; + (void) (CLong) v; + (void) (CFloat) v; + (void) (CDouble) v; + (void) (VoidPtr) v; + (void) (CharPtr) v; +} + +void testLong(Long v) { + (void) (Bool) v; + (void) (Int) v; + (void) (Long) v; + (void) (Float) v; + (void) (Double) v; + (void) (CInt) v; + (void) (CLong) v; + (void) (CFloat) v; + (void) (CDouble) v; + (void) (VoidPtr) v; + (void) (CharPtr) v; +} + +void testFloat(Float v) { + (void) (Bool) v; + (void) (Int) v; + (void) (Long) v; + (void) (Float) v; + (void) (Double) v; + (void) (CInt) v; + (void) (CLong) v; + (void) (CFloat) v; + (void) (CDouble) v; +} + +void testDouble(Double v) { + (void) (Bool) v; + (void) (Int) v; + (void) (Long) v; + (void) (Float) v; + (void) (Double) v; + (void) (CInt) v; + (void) (CLong) v; + (void) (CFloat) v; + (void) (CDouble) v; +} + +void testCI(CInt v) { + (void) (Bool) v; + (void) (Int) v; + (void) (Long) v; + (void) (Float) v; + (void) (Double) v; + (void) (CInt) v; + (void) (CLong) v; + (void) (CFloat) v; + (void) (CDouble) v; +} + +void testCLong(CLong v) { + (void) (Bool) v; + (void) (Int) v; + (void) (Long) v; + (void) (Float) v; + (void) (Double) v; + (void) (CInt) v; + (void) (CLong) v; + (void) (CFloat) v; + (void) (CDouble) v; +} + +void testCFloat(CFloat v) { + (void) (Bool) v; + (void) (Int) v; + (void) (Long) v; + (void) (Float) v; + (void) (Double) v; + (void) (CInt) v; + (void) (CLong) v; + (void) (CFloat) v; + (void) (CDouble) v; +} + +void testCDouble(CDouble v) { + (void) (Bool) v; + (void) (Int) v; + (void) (Long) v; + (void) (Float) v; + (void) (Double) v; + (void) (CInt) v; + (void) (CLong) v; + (void) (CFloat) v; + (void) (CDouble) v; +} + +void testVoidPtr(VoidPtr v) { + (void) (Bool) v; + (void) (Int) v; + (void) (Long) v; + (void) (VoidPtr) v; + (void) (CharPtr) v; +} + +void testCharPtr(CharPtr v) { + (void) (Bool) v; + (void) (Int) v; + (void) (Long) v; + (void) (VoidPtr) v; + (void) (CharPtr) v; +} |