1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
3 namespace rdar8818236
{
12 // CHECK: @_ZN11rdar88182363fooE ={{.*}} global i64 4
33 // CHECK-LABEL: define{{.*}} void @_ZN6PR70211fENS_1XES0_
37 // CHECK: store i64 1, ptr
40 // CHECK: call void @llvm.memcpy.p0.p0.i64
44 // CHECK: call void @llvm.memcpy.p0.p0.i64
63 // CHECK-LABEL: define{{.*}} void @_ZN5test21AC2Ev(
65 // CHECK: store i32 10
81 // CHECK-LABEL: define{{.*}} void @_ZN7PR105121AC2Ev
82 // CHECK: [[THISADDR:%[a-zA-Z0-9.]+]] = alloca ptr
83 // CHECK-NEXT: store ptr [[THIS:%[a-zA-Z0-9.]+]], ptr [[THISADDR]]
84 // CHECK-NEXT: [[THIS1:%[a-zA-Z0-9.]+]] = load ptr, ptr [[THISADDR]]
85 // CHECK-NEXT: ret void
88 // CHECK-LABEL: define{{.*}} void @_ZN7PR105121AC2Ei
89 // CHECK: [[THISADDR:%[a-zA-Z0-9.]+]] = alloca ptr
90 // CHECK-NEXT: [[XADDR:%[a-zA-Z0-9.]+]] = alloca i32
91 // CHECK-NEXT: store ptr [[THIS:%[a-zA-Z0-9.]+]], ptr [[THISADDR]]
92 // CHECK-NEXT: store i32 [[X:%[a-zA-Z0-9.]+]], ptr [[XADDR]]
93 // CHECK-NEXT: [[THIS1:%[a-zA-Z0-9.]+]] = load ptr, ptr [[THISADDR]]
94 // CHECK-NEXT: {{getelementptr inbounds.*i32 0, i32 0}}
95 // CHECK-NEXT: {{getelementptr inbounds.*i32 0, i32 0}}
96 // CHECK-NEXT: {{getelementptr inbounds.*i32 0, i32 0}}
97 // CHECK-NEXT: [[TMP:%[a-zA-Z0-9.]+]] = load i32, ptr [[XADDR]]
98 // CHECK-NEXT: store i32 [[TMP]]
99 // CHECK-NEXT: ret void
100 A::A(int x
) : x(x
) { }
102 // CHECK-LABEL: define{{.*}} void @_ZN7PR105121AC2El
103 // CHECK: [[THISADDR:%[a-zA-Z0-9.]+]] = alloca ptr
104 // CHECK-NEXT: [[XADDR:%[a-zA-Z0-9.]+]] = alloca i64
105 // CHECK-NEXT: store ptr [[THIS:%[a-zA-Z0-9.]+]], ptr [[THISADDR]]
106 // CHECK-NEXT: store i64 [[X:%[a-zA-Z0-9.]+]], ptr [[XADDR]]
107 // CHECK-NEXT: [[THIS1:%[a-zA-Z0-9.]+]] = load ptr, ptr [[THISADDR]]
108 // CHECK-NEXT: {{getelementptr inbounds.*i32 0, i32 0}}
109 // CHECK-NEXT: {{getelementptr inbounds.*i32 0, i32 1}}
110 // CHECK-NEXT: {{getelementptr inbounds.*i32 0, i32 0}}
111 // CHECK-NEXT: [[TMP:%[a-zA-Z0-9.]+]] = load i64, ptr [[XADDR]]
112 // CHECK-NEXT: [[CONV:%[a-zA-Z0-9.]+]] = trunc i64 [[TMP]] to i32
113 // CHECK-NEXT: store i32 [[CONV]]
114 // CHECK-NEXT: ret void
115 A::A(long y
) : y(y
) { }
121 mutable char fibers
[100];
123 void (*callback
)(void*);
124 void *callback_value
;
131 A::A() : callback(0), callback_value(0) {}
132 // CHECK-LABEL: define{{.*}} void @_ZN5test31AC2Ev(
133 // CHECK: [[THIS:%.*]] = load
134 // CHECK-NEXT: [[UNION:%.*]] = getelementptr inbounds {{.*}} [[THIS]], i32 0, i32 0
135 // CHECK-NEXT: [[CALLBACK:%.*]] = getelementptr inbounds {{.*}} [[UNION]], i32 0, i32 0
137 // CHECK-NEXT: [[UNION:%.*]] = getelementptr inbounds {{.*}} [[THIS]], i32 0, i32 0
138 // CHECK-NEXT: [[CVALUE:%.*]] = getelementptr inbounds {{.*}} [[UNION]], i32 0, i32 1
139 // CHECK-NEXT: store ptr null, ptr [[CVALUE]]
143 // CHECK: store i32 42
144 // CHECK: store i32 55
145 S() : x(42), y(55) {}
156 template <typename T
> struct Foo
{
157 Foo() : ptr(__nullptr
) {}
170 unsigned mSubmissionTag
;
181 struct IndirectReferenceField
{
185 IndirectReferenceField(float &x
);
187 IndirectReferenceField::IndirectReferenceField(float &xx
) : x(xx
) {}