]> git.proxmox.com Git - rustc.git/blame - src/llvm/unittests/IR/TypesTest.cpp
Imported Upstream version 1.0.0+dfsg1
[rustc.git] / src / llvm / unittests / IR / TypesTest.cpp
CommitLineData
970d7e83 1//===- llvm/unittest/IR/TypesTest.cpp - Type unit tests -------------------===//
223e47cc
LB
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
970d7e83
LB
10#include "llvm/IR/DerivedTypes.h"
11#include "llvm/IR/LLVMContext.h"
223e47cc
LB
12#include "gtest/gtest.h"
13using namespace llvm;
14
15namespace {
16
17TEST(TypesTest, StructType) {
18 LLVMContext C;
19
20 // PR13522
21 StructType *Struct = StructType::create(C, "FooBar");
22 EXPECT_EQ("FooBar", Struct->getName());
23 Struct->setName(Struct->getName().substr(0, 3));
24 EXPECT_EQ("Foo", Struct->getName());
25 Struct->setName("");
26 EXPECT_TRUE(Struct->getName().empty());
27 EXPECT_FALSE(Struct->hasName());
28}
29
30} // end anonymous namespace