Skip to content

Commit fbe4c6f

Browse files
committed
Adapt lit-tests to new lambda mangles
1 parent 0cc47d9 commit fbe4c6f

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

tests/codegen/funcliteral_defaultarg_gh1634.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ int foo(int function() d = () { return 123; })
1414
// CHECK-LABEL: define{{.*}} @{{.*}}D3mod8call_fooFZi
1515
int call_foo()
1616
{
17-
// CHECK: call {{.*}}D3mod3fooFPFZiZi{{.*}}D3mod9__lambda5FNaNbNiNfZi
17+
// CHECK: call {{.*}}D3mod3fooFPFZiZi{{.*}}D3mod15__lambda_L9_C28FNaNbNiNfZi
1818
return foo();
1919
}
2020

2121
// The lambda is defined by the first call to foo with default arguments.
22-
// CHECK-LABEL: define{{.*}} @{{.*}}D3mod9__lambda5FNaNbNiNfZi
22+
// CHECK-LABEL: define{{.*}} @{{.*}}D3mod15__lambda_L9_C28FNaNbNiNfZi
2323
// CHECK: ret i32 123
2424

2525
// CHECK-LABEL: define{{.*}} @{{.*}}Dmain
2626
void main()
2727
{
28-
// CHECK: call {{.*}}D3mod3fooFPFZiZi{{.*}}D3mod9__lambda5FNaNbNiNfZi
28+
// CHECK: call {{.*}}D3mod3fooFPFZiZi{{.*}}D3mod15__lambda_L9_C28FNaNbNiNfZi
2929
assert(foo() == 123);
3030
}

tests/codegen/lambdas_gh3648.d

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@ void foo()
2626
}
2727

2828
// the global variables should be defined as internal:
29-
// CHECK: _D14lambdas_gh36489__lambda5FZ10global_bari{{.*}} = internal thread_local global
30-
// CHECK: _D14lambdas_gh36489__lambda6FZ18global_bar_inlinedOi{{.*}} = internal global
31-
// CHECK: _D14lambdas_gh36483fooFZ__T9__lambda1TiZQnFiZ12lambda_templi{{.*}} = internal global
29+
// CHECK: _D14lambdas_gh364815__lambda_L5_C12FZ10global_bari{{.*}} = internal thread_local global
30+
// CHECK: _D14lambdas_gh364816__lambda_L10_C20FZ18global_bar_inlinedOi{{.*}} = internal global
31+
// CHECK: _D14lambdas_gh36483fooFZ__T15__lambda_L21_C5TiZQuFiZ12lambda_templi{{.*}} = internal global
3232

3333
// foo() should only call two lambdas:
3434
// CHECK: define {{.*}}_D14lambdas_gh36483fooFZv
35-
// CHECK-NEXT: call {{.*}}__lambda5
36-
// CHECK-NEXT: call {{.*}}__T9__lambda1
35+
// CHECK-NEXT: call {{.*}}__lambda_L5_C12
36+
// CHECK-NEXT: call {{.*}}__T15__lambda_L21_C5
3737
// CHECK-NEXT: ret void
3838

3939
// bar() should be defined as internal:
40-
// CHECK: define internal {{.*}}__lambda5
40+
// CHECK: define internal {{.*}}__lambda_L5_C12
4141

4242
// bar_inlined() should NOT have made it to the .ll:
43-
// CHECK-NOT: define {{.*}}__lambda6
43+
// CHECK-NOT: define {{.*}}__lambda_L10_C20
4444

4545
// the template lambda instance should be defined as internal:
46-
// CHECK: define internal {{.*}}__T9__lambda1
46+
// CHECK: define internal {{.*}}__T15__lambda_L21_C5

tests/codegen/lambdas_gh3648b.d

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ void foo()
1111
}
1212

1313
// the global variables should be defined as internal:
14-
// CHECK: _D14lambdas_gh36489__lambda5FZ10global_bari{{.*}} = internal thread_local global
15-
// CHECK: _D14lambdas_gh36489__lambda6FZ18global_bar_inlinedOi{{.*}} = internal global
14+
// CHECK: _D14lambdas_gh364815__lambda_L5_C12FZ10global_bari{{.*}} = internal thread_local global
15+
// CHECK: _D14lambdas_gh364816__lambda_L10_C20FZ18global_bar_inlinedOi{{.*}} = internal global
1616

1717
// foo() should only call one lambda:
1818
// CHECK: define {{.*}}_D15lambdas_gh3648b3fooFZv
19-
// CHECK-NEXT: call {{.*}}__lambda5
19+
// CHECK-NEXT: call {{.*}}__lambda_L5_C12
2020
// CHECK-NEXT: ret void
2121

2222
// bar() should be defined as internal:
23-
// CHECK: define internal {{.*}}__lambda5
23+
// CHECK: define internal {{.*}}__lambda_L5_C12
2424

2525
// bar_inlined() should NOT have made it to the .ll:
26-
// CHECK-NOT: define {{.*}}__lambda6
26+
// CHECK-NOT: define {{.*}}__lambda_L10_C20

tests/dmd/runnable/test23722.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// COMPILE_SEPARATELY:
22
// EXTRA_SOURCES: imports/test23722b.d
3-
// REQUIRED_ARGS: -betterC
3+
// rEQUIRED_ARGS: -betterC // disabled for LDC as the test is 'buggy' and betterC not required at all
44
// https://issues.dlang.org/show_bug.cgi?id=23722
55
// Lambdas are mangled incorrectly when using multiple compilation units, resulting in incorrect code
66
import imports.test23722b;

0 commit comments

Comments
 (0)