@@ -35,7 +35,9 @@ int test1(int x) {
35
35
int noProto2 ();
36
36
int test2 (int x ) {
37
37
return noProto2 (x );
38
- // CHECK: %{{.+}} = cir.call @noProto2(%{{[0-9]+}}) : (!s32i) -> !s32i
38
+ // CHECK: [[GGO:%.*]] = cir.get_global @noProto2 : cir.ptr <!cir.func<!s32i (!s32i)>>
39
+ // CHECK: [[CAST:%.*]] = cir.cast(bitcast, %3 : !cir.ptr<!cir.func<!s32i (!s32i)>>), !cir.ptr<!cir.func<!s32i (!s32i)>>
40
+ // CHECK: {{.*}} = cir.call [[CAST]](%{{[0-9]+}}) : (!cir.ptr<!cir.func<!s32i (!s32i)>>, !s32i) -> !s32i
39
41
}
40
42
int noProto2 (int x ) { return x ; }
41
43
// CHECK: cir.func no_proto @noProto2(%arg0: !s32i {{.+}}) -> !s32i
@@ -49,7 +51,9 @@ int noProto3();
49
51
int test3 (int x ) {
50
52
// CHECK: cir.func @test3
51
53
return noProto3 (x );
52
- // CHECK: %{{.+}} = cir.call @noProto3(%{{[0-9]+}}) : (!s32i) -> !s32i
54
+ // CHECK: [[GGO:%.*]] = cir.get_global @noProto3 : cir.ptr <!cir.func<!s32i (...)>>
55
+ // CHECK: [[CAST:%.*]] = cir.cast(bitcast, [[GGO]] : !cir.ptr<!cir.func<!s32i (...)>>), !cir.ptr<!cir.func<!s32i (!s32i)>>
56
+ // CHECK: {{%.*}} = cir.call [[CAST]](%{{[0-9]+}}) : (!cir.ptr<!cir.func<!s32i (!s32i)>>, !s32i) -> !s32i
53
57
}
54
58
55
59
@@ -64,14 +68,18 @@ int noProto4() { return 0; }
64
68
// cir.func private no_proto @noProto4() -> !s32i
65
69
int test4 (int x ) {
66
70
return noProto4 (x ); // Even if we know the definition, this should compile.
67
- // CHECK: %{{.+}} = cir.call @noProto4(%{{.+}}) : (!s32i) -> !s32i
71
+ // CHECK: [[GGO:%.*]] = cir.get_global @noProto4 : cir.ptr <!cir.func<!s32i ()>>
72
+ // CHECK: [[CAST:%.*]] = cir.cast(bitcast, [[GGO]] : !cir.ptr<!cir.func<!s32i ()>>), !cir.ptr<!cir.func<!s32i (!s32i)>>
73
+ // CHECK: {{%.*}} = cir.call [[CAST]]({{%.*}}) : (!cir.ptr<!cir.func<!s32i (!s32i)>>, !s32i) -> !s32i
68
74
}
69
75
70
76
// No-proto definition followed by an incorrect call due to lack of args.
71
77
int noProto5 ();
72
78
int test5 (int x ) {
73
79
return noProto5 ();
74
- // CHECK: %{{.+}} = cir.call @noProto5() : () -> !s32i
80
+ // CHECK: [[GGO:%.*]] = cir.get_global @noProto5 : cir.ptr <!cir.func<!s32i (!s32i)>>
81
+ // CHECK: [[CAST:%.*]] = cir.cast(bitcast, [[GGO]] : !cir.ptr<!cir.func<!s32i (!s32i)>>), !cir.ptr<!cir.func<!s32i ()>>
82
+ // CHECK: {{%.*}} = cir.call [[CAST]]() : (!cir.ptr<!cir.func<!s32i ()>>) -> !s32i
75
83
}
76
84
int noProto5 (int x ) { return x ; }
77
85
// CHECK: cir.func no_proto @noProto5(%arg0: !s32i {{.+}}) -> !s32i
0 commit comments