File tree Expand file tree Collapse file tree 1 file changed +29
-2
lines changed Expand file tree Collapse file tree 1 file changed +29
-2
lines changed Original file line number Diff line number Diff line change 1
1
// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
2
2
// RUN: FileCheck --input-file=%t.cir %s
3
- // XFAIL: *
4
3
4
+ // CHECK: _Z23unreachable_after_breaki
5
5
void unreachable_after_break (int a) {
6
6
switch (a) {
7
7
case 0 :
8
8
break ;
9
9
break ;
10
10
int x = 1 ;
11
11
}
12
+ // cir.switch
13
+ // cir.case(equal, [#cir.int<0> : !s32i]) {
14
+ // cir.break
15
+ // ^bb{{.*}}: // no predecessors
16
+ // cir.break
17
+ // ^bb{{.*}}: // no predecessors
18
+ // %[[CONST:.*]] = cir.const #cir.int<1> : !s32i
19
+ // cir.store align(4) {{.*}}, %[[CONST]]
20
+ // cir.yield
12
21
}
13
22
23
+ // CHECK: _Z24unreachable_after_returni
14
24
int unreachable_after_return (int a) {
15
25
switch (a) {
16
26
case 0 :
17
27
return 0 ;
18
28
return 1 ;
19
- int x = 1 ;
29
+ int x = 3 ;
20
30
}
21
31
return 2 ;
32
+ // cir.switch
33
+ // cir.case(equal, [#cir.int<0> : !s32i]) {
34
+ // %[[CONST_ZERO:.*]] = cir.const #cir.int<0> : !s32i
35
+ // cir.store {{.*}}, %[[CONST_ZERO]]
36
+ // cir.br ^bb1
37
+ // ^bb1: // 2 preds: ^bb0, ^bb2
38
+ // cir.load
39
+ // cir.return
40
+ // ^bb2: // no predecessors
41
+ // %[[CONST_ONE:.*]] = cir.const #cir.int<1> : !s32i
42
+ // cir.store %[[CONST_ONE]]
43
+ // cir.br ^bb1
44
+ // ^bb3: // no predecessors
45
+ // %[[CONST_THREE:.*]] = cir.const #cir.int<3> : !s32i
46
+ // cir.store align(4) %[[CONST_THREE]]
47
+ // cir.yield
48
+ // }
22
49
}
You can’t perform that action at this time.
0 commit comments