From ec2b103c267a06a66e926f62cd96767b280f5cf5 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Tue, 2 Jun 2009 17:58:47 +0000 Subject: Import Clang, at r72732. --- test/Parser/cxx-casting.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 test/Parser/cxx-casting.cpp (limited to 'test/Parser/cxx-casting.cpp') diff --git a/test/Parser/cxx-casting.cpp b/test/Parser/cxx-casting.cpp new file mode 100644 index 0000000000000..1fdc28d2c8800 --- /dev/null +++ b/test/Parser/cxx-casting.cpp @@ -0,0 +1,36 @@ +// RUN: clang-cc -fsyntax-only %s + +char *const_cast_test(const char *var) +{ + return const_cast(var); +} + +#if 0 +// FIXME: Uncomment when C++ is supported more. +struct A { + virtual ~A() {} +}; + +struct B : public A { +}; + +struct B *dynamic_cast_test(struct A *a) +{ + return dynamic_cast(a); +} +#endif + +char *reinterpret_cast_test() +{ + return reinterpret_cast(0xdeadbeef); +} + +double static_cast_test(int i) +{ + return static_cast(i); +} + +char postfix_expr_test() +{ + return reinterpret_cast(0xdeadbeef)[0]; +} -- cgit v1.2.3