diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-07-20 16:32:20 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-07-20 16:32:20 +0000 |
commit | 704524ae7087bd44a03d7c3e110e8ac9b7ffba9c (patch) | |
tree | 6a91b801948783508e992dc00b7b59a5b3e2eb24 /llvm/unittests/Support/Casting.cpp | |
parent | d1488fd8bc858d15b457fa4183c80f0b31269177 (diff) | |
download | llvm-704524ae7087bd44a03d7c3e110e8ac9b7ffba9c.zip llvm-704524ae7087bd44a03d7c3e110e8ac9b7ffba9c.tar.gz llvm-704524ae7087bd44a03d7c3e110e8ac9b7ffba9c.tar.bz2 |
initial checkin for unittest to exercise Support/Casting.h
this is still minimal on purpose, but I plan to migrate the ugly
hack under #ifdef DEBUG_CAST_OPERATORS into this file
llvm-svn: 108849
Diffstat (limited to 'llvm/unittests/Support/Casting.cpp')
-rw-r--r-- | llvm/unittests/Support/Casting.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/llvm/unittests/Support/Casting.cpp b/llvm/unittests/Support/Casting.cpp new file mode 100644 index 0000000..d7e89f8 --- /dev/null +++ b/llvm/unittests/Support/Casting.cpp @@ -0,0 +1,32 @@ +//===---------- llvm/unittest/Support/Casting.cpp - Casting tests --------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "llvm/Support/raw_ostream.h" +#include "llvm/Support/Debug.h" +#define DEBUG_CAST_OPERATORS +#include "llvm/Support/Casting.h" + +#include "gtest/gtest.h" +#include <cstdlib> + +using namespace llvm; + +namespace { + +extern bar &B1; +extern const bar *B2; + +TEST(CastingTest, Basics) { + EXPECT_TRUE(isa<foo>(B1)); +} + +bar B; +bar &B1 = B; +const bar *B2 = &B; +} // anonymous namespace |