// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-apple-darwin10 -fblocks -fobjc-arc -emit-llvm -o - %s | FileCheck %s
// Parameterized classes have no effect on code generation; this test
// mainly verifies that CodeGen doesn't assert when substituted types
// in uses of methods don't line up exactly with the parameterized
// types in the method declarations due to type erasure. "Not crash"
// is the only interesting criteria here.
NSString *
NSString *
void
int
int
void
void
void
// CHECK-LABEL: define{{.*}} void @blockTest
void
// CHECK-LABEL: define internal void @"\01-[Derived setDest:]
// CHECK: %[[SELFADDR:.*]] = alloca %[[SELFTY:.*]]*
// CHECK: %[[AADDR:.*]] = alloca %[[IVARTY:.*]]*
// CHECK: %[[V2:.*]] = load %[[IVARTY]]*, %[[IVARTY]]** %[[AADDR]]
// CHECK: %[[V3:.*]] = load %[[SELFTY]]*, %[[SELFTY]]** %[[SELFADDR]]
// CHECK: %[[IVAR:.*]] = load i64, i64* @"OBJC_IVAR_$_Base._destination"
// CHECK: %[[V4:.*]] = bitcast %[[SELFTY]]* %[[V3]] to i8*
// CHECK: %[[ADDPTR:.*]] = getelementptr inbounds i8, i8* %[[V4]], i64 %[[IVAR]]
// CHECK: %[[V5:.*]] = bitcast i8* %[[ADDPTR]] to %[[IVARTY]]**
// CHECK: %[[V6:.*]] = bitcast %[[IVARTY]]** %[[V5]] to i8**
// CHECK: %[[V7:.*]] = bitcast %[[IVARTY]]* %[[V2]] to i8*
// CHECK: call void @llvm.objc.storeStrong(i8** %[[V6]], i8* %[[V7]])
// CHECK-LABEL: define internal void @"\01-[C0 foo1]"(
// CHECK: {{.*}} = alloca
// CHECK: {{.*}} = alloca
// CHECK: %[[D:.*]] = alloca %[[TY:.*]]*
// CHECK: %[[TEMP:.*]] = alloca %[[TY]]*
// CHECK: %[[V4:.*]] = load %[[TY]]*, %[[TY]]** %[[D]]
// CHECK: store %[[TY]]* %[[V4]], %[[TY]]** %[[TEMP]]
// CHECK: %[[V7:.*]] = bitcast %[[TY]]** %[[TEMP]] to i8**
// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i8**)*)(i8* noundef %{{.*}}, i8* noundef %{{.*}}, i8** noundef %[[V7]])