Casting.cpp revision ee57dae3d8bcb2f3f41eb225bc615045d13d9dda
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
18using namespace llvm;
19
20namespace {
21
22extern bar &B1;
23extern const bar *B2;
24
25TEST(CastingTest, Basics) {
26  EXPECT_TRUE(isa<foo>(B1));
27}
28
29bar B;
30bar &B1 = B;
31const bar *B2 = &B;
32}  // anonymous namespace
33