mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-16 20:40:16 +00:00
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108849 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
082d6b6536
commit
ee57dae3d8
32
unittests/Support/Casting.cpp
Normal file
32
unittests/Support/Casting.cpp
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user