[Flang][OpenMP] Handle SECTION construct from within SECTIONS (#77759)
[llvm-project.git] / mlir / utils / tree-sitter-mlir / test / highlight / controlflow.mlir
blobd3193838c3a7380f532d9b2836e0f10cd3154d81
1 func.func @simple(i64, i1) -> i64 {
2 // <- function.builtin
3 //        ^ function
4 //               ^ punctuation.bracket
5 //                ^ type.builtin
6 //                   ^ punctuation.delimeter
7 //                     ^ type.builtin
8 //                       ^ punctuation.bracket
9 //                         ^ operator
10 //                            ^ type.builtin
11 //                                ^ punctuation.bracket
12 ^bb0(%a: i64, %cond: i1):
13 // <- tag
14 //   ^ variable.parameter
15 //       ^ type.builtin
16 //            ^ variable.parameter
17 //                   ^ type.builtin
18   cf.cond_br %cond, ^bb1, ^bb2
19 // ^ function.builtin
20 //           ^ variable.parameter
21 //                  ^ tag
22 //                        ^ tag
24 ^bb1:
25 // <- tag
26   cf.br ^bb3(%a: i64)    // Branch passes %a as the argument
27 // ^ function.builtin
28 //      ^ tag
29 //           ^ variable.parameter
30 //               ^ type.builtin
31 //                       ^ comment
33 ^bb2:
34 // <- tag
35   %b = arith.addi %a, %a : i64
36 // ^ variable
37 //   ^ operator
38 //     ^ function.builtin
39 //                ^ variable.parameter
40 //                    ^ variable.parameter
41 //                         ^ type.builtin
42   cf.br ^bb3(%b: i64)    // Branch passes %b as the argument
43 // ^ function.builtin
44 //      ^ tag
45 //           ^ variable
46 //               ^ type.builtin
47 //                       ^ comment
48 ^bb3(%c: i64):
49 // <- tag
50 //   ^ variable.parameter
51 //        ^ type.builtin
52   cf.br ^bb4(%c, %a : i64, i64)
53 // ^ function.builtin
54 //      ^ tag
55 //           ^ variable.parameter
56 //               ^ variable.parameter
57 //                    ^ type.builtin
58 //                         ^ type.builtin
59 ^bb4(%d : i64, %e : i64):
60 // <- tag
61 //   ^ variable.parameter
62 //        ^ type.builtin
63 //             ^ variable.parameter
64 //                  ^ type.builtin
65   %0 = arith.addi %d, %e : i64
66 // ^ variable
67 //   ^ operator
68 //     ^ function.builtin
69 //                ^ variable.parameter
70 //                    ^ variable.parameter
71 //                          ^ type.builtin
72   return %0 : i64   // Return is also a terminator.
73 // ^ function.builtin
74 //       ^ variable
75 //            ^ type.builtin
76 //                  ^ comment
78 // <- punctuation.bracket