xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjCXX/gc.mm (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambucnamespace test0 {
4*f4a2713aSLionel Sambuc  extern id x;
5*f4a2713aSLionel Sambuc
6*f4a2713aSLionel Sambuc  struct A {
7*f4a2713aSLionel Sambuc    id x;
8*f4a2713aSLionel Sambuc    A();
9*f4a2713aSLionel Sambuc  };
10*f4a2713aSLionel Sambuc  A::A() : x(test0::x) {}
11*f4a2713aSLionel Sambuc
12*f4a2713aSLionel Sambuc// CHECK-LABEL:    define void @_ZN5test01AC2Ev(
13*f4a2713aSLionel Sambuc// CHECK:      [[THIS:%.*]] = alloca [[TEST0:%.*]]*, align 8
14*f4a2713aSLionel Sambuc// CHECK-NEXT: store
15*f4a2713aSLionel Sambuc// CHECK-NEXT: [[T0:%.*]] = load [[TEST0]]** [[THIS]]
16*f4a2713aSLionel Sambuc// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[TEST0]]* [[T0]], i32 0, i32 0
17*f4a2713aSLionel Sambuc// CHECK-NEXT: [[T2:%.*]] = load i8** @_ZN5test01xE
18*f4a2713aSLionel Sambuc// CHECK-NEXT: call i8* @objc_assign_strongCast(i8* [[T2]], i8** [[T1]])
19*f4a2713aSLionel Sambuc// CHECK-NEXT: ret void
20*f4a2713aSLionel Sambuc}
21