Skip to content

Commit e1700b6

Browse files
[LLVM22
1 parent 36fa56a commit e1700b6

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

tests/codegen/lifetime_local_variables.d

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,61 @@ void foo_struct_foo() {
120120
// CHECK: call void @llvm.lifetime.end.p0{{(i8)?}}(i64 immarg 123
121121
// CHECK-NEXT: ret void
122122
}
123+
124+
struct CodepointSet
125+
{
126+
CodepointSet opBinary(string op, U)(U )
127+
{
128+
return this;
129+
}
130+
131+
this(this) { }
132+
}
133+
134+
CodepointSet memoizeExpr(string expr)()
135+
{
136+
if (__ctfe)
137+
return mixin(expr);
138+
CodepointSet slot;
139+
return slot;
140+
}
141+
142+
struct unicode
143+
{
144+
static CodepointSet opDispatch(string name)()
145+
{
146+
CodepointSet set;
147+
return set;
148+
}
149+
}
150+
151+
void wordCharacter() {
152+
// CHECK-LABEL: define void @wordCharacter()
153+
// CHECK-NOT: call void @llvm.lifetime.start.p0{{(i8)?}}({{.*}}sret
154+
memoizeExpr!"unicode.A | unicode.M";
155+
// CHECK-LABEL: ret void
156+
}
157+
158+
struct Grapheme
159+
{
160+
/// Ctor
161+
this(C)(C) { }
162+
163+
this(this) { }
164+
165+
~this() { }
166+
}
167+
168+
enum jamoLBase = 0x1100;
169+
170+
Grapheme decomposeHangul(dchar ch) {
171+
// CHECK-LABEL: define void @decomposeHangul()
172+
immutable idxS = ch ;
173+
immutable idxT = idxS ;
174+
175+
immutable partL = jamoLBase ;
176+
// CHECK-NOT: call void @llvm.lifetime.start.p0{{(i8)?}}({{.*}}sret
177+
if (idxT )
178+
return Grapheme(partL);
179+
return Grapheme();
180+
}

0 commit comments

Comments
 (0)