Gabor Greif | ee57dae | 2010-07-20 16:32:20 +0000 | [diff] [blame^] | 1 | //===---------- llvm/unittest/Support/Casting.cpp - Casting tests --------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "llvm/Support/raw_ostream.h" |
| 11 | #include "llvm/Support/Debug.h" |
| 12 | #define DEBUG_CAST_OPERATORS |
| 13 | #include "llvm/Support/Casting.h" |
| 14 | |
| 15 | #include "gtest/gtest.h" |
| 16 | #include <cstdlib> |
| 17 | |
| 18 | using namespace llvm; |
| 19 | |
| 20 | namespace { |
| 21 | |
| 22 | extern bar &B1; |
| 23 | extern const bar *B2; |
| 24 | |
| 25 | TEST(CastingTest, Basics) { |
| 26 | EXPECT_TRUE(isa<foo>(B1)); |
| 27 | } |
| 28 | |
| 29 | bar B; |
| 30 | bar &B1 = B; |
| 31 | const bar *B2 = &B; |
| 32 | } // anonymous namespace |