Mercurial > hg > CbC > CbC_llvm
diff clang/test/CodeGenObjC/nontrivial-c-struct-within-struct-name.m @ 150:1d019706d866
LLVM10
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 15:10:13 +0900 |
parents | |
children | c4bab56944e8 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clang/test/CodeGenObjC/nontrivial-c-struct-within-struct-name.m Thu Feb 13 15:10:13 2020 +0900 @@ -0,0 +1,44 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios11 -fobjc-arc -emit-llvm -o - %s | FileCheck %s + +@class I; + +typedef struct { + I *name; +} Foo; + +typedef struct { + Foo foo; +} Bar; + +typedef struct { + Bar bar; +} Baz; + +I *getI(); + +void f() { + Foo foo = {getI()}; + Bar bar = {foo}; + Baz baz = {bar}; +} + +// CHECK: define linkonce_odr hidden void @__destructor_8_S_S_s0(i8** %[[DST:.*]]) +// CHECK: %[[DST_ADDR:.*]] = alloca i8**, align 8 +// CHECK: store i8** %[[DST]], i8*** %[[DST_ADDR]], align 8 +// CHECK: %[[V0:.*]] = load i8**, i8*** %[[DST_ADDR]], align 8 +// CHECK: call void @__destructor_8_S_s0(i8** %[[V0]]) +// CHECK: ret void + +// CHECK: define linkonce_odr hidden void @__destructor_8_S_s0(i8** %[[DST:.*]]) +// CHECK: %[[DST_ADDR:.*]] = alloca i8**, align 8 +// CHECK: store i8** %[[DST]], i8*** %[[DST_ADDR]], align 8 +// CHECK: %[[V0:.*]] = load i8**, i8*** %[[DST_ADDR]], align 8 +// CHECK: call void @__destructor_8_s0(i8** %[[V0]]) +// CHECK: ret void + +// CHECK: define linkonce_odr hidden void @__destructor_8_s0(i8** %dst) +// CHECK: %[[DST_ADDR:.*]] = alloca i8**, align 8 +// CHECK: store i8** %[[DST]], i8*** %[[DST_ADDR]], align 8 +// CHECK: %[[V0:.*]] = load i8**, i8*** %[[DST_ADDR]], align 8 +// CHECK: call void @llvm.objc.storeStrong(i8** %[[V0]], i8* null) +// CHECK: ret void