llvm.org GIT mirror llvm / f202c43
Strip trailing whitespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128622 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan Sands 9 years ago
2 changed file(s) with 14 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
1818
1919 static void PR7658() {
2020 LLVMContext ctx;
21
21
2222 WeakVH NullPtr;
2323 PATypeHolder h1;
2424 {
2525 OpaqueType *o1 = OpaqueType::get(ctx);
2626 PointerType *p1 = PointerType::get(o1, 0);
27
27
2828 std::vector t1;
2929 t1.push_back(IntegerType::get(ctx, 32));
3030 t1.push_back(p1);
3232 OpaqueType *o2 = OpaqueType::get (ctx);
3333 PointerType *p2 = PointerType::get (o2, 0);
3434 t1.push_back(p2);
35
36
35
36
3737 StructType *s1 = StructType::get(ctx, t1);
3838 h1 = s1;
3939 o1->refineAbstractTypeTo(s1);
4040 o2->refineAbstractTypeTo(h1.get()); // h1 = { i32, \2*, \2* }
4141 }
42
43
42
43
4444 OpaqueType *o3 = OpaqueType::get(ctx);
4545 PointerType *p3 = PointerType::get(o3, 0); // p3 = opaque*
46
46
4747 std::vector t2;
4848 t2.push_back(IntegerType::get(ctx, 32));
4949 t2.push_back(p3);
50
50
5151 std::vector v2;
5252 v2.push_back(ConstantInt::get(IntegerType::get(ctx, 32), 14));
5353 v2.push_back(ConstantPointerNull::get(p3));
54
54
5555 OpaqueType *o4 = OpaqueType::get(ctx);
5656 {
5757 PointerType *p4 = PointerType::get(o4, 0);
5858 t2.push_back(p4);
5959 v2.push_back(ConstantPointerNull::get(p4));
6060 }
61
61
6262 WeakVH CS = ConstantStruct::get(ctx, v2, false); // { i32 14, opaque* null, opaque* null}
63
63
6464 StructType *s2 = StructType::get(ctx, t2);
6565 PATypeHolder h2(s2);
6666 o3->refineAbstractTypeTo(s2);
6767 o4->refineAbstractTypeTo(h2.get());
6868 }
69
69
7070
7171 TEST(OpaqueTypeTest, RegisterWithContext) {
7272 LLVMContext C;
8080 EXPECT_EQ(2u, pImpl->OpaqueTypes.size());
8181 }
8282 EXPECT_EQ(1u, pImpl->OpaqueTypes.size());
83
83
8484 PR7658();
8585 }
8686
3939 void initializeCGPassPass(PassRegistry&);
4040 void initializeLPassPass(PassRegistry&);
4141 void initializeBPassPass(PassRegistry&);
42
42
4343 namespace {
4444 // ND = no deps
4545 // NM = no modifications