File: concat.fir

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (62 lines) | stat: -rw-r--r-- 3,344 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Test hlfir.concat operation parse, verify (no errors), and unparse.

// RUN: fir-opt %s | fir-opt | FileCheck %s

func.func @concat_var(%arg0: !fir.ref<!fir.char<1,10>>, %arg1: !fir.ref<!fir.char<1,20>>) {
  %c30 = arith.constant 30 : index
  %0 = hlfir.concat %arg0, %arg1 len %c30 : (!fir.ref<!fir.char<1,10>>, !fir.ref<!fir.char<1,20>>, index) -> (!hlfir.expr<!fir.char<1,30>>)
  return
}
// CHECK-LABEL:   func.func @concat_var(
// CHECK-SAME:    %[[VAL_0:.*]]: !fir.ref<!fir.char<1,10>>,
// CHECK-SAME:    %[[VAL_1:.*]]: !fir.ref<!fir.char<1,20>>) {
// CHECK:  %[[VAL_2:.*]] = arith.constant 30 : index
// CHECK:  %[[VAL_3:.*]] = hlfir.concat %[[VAL_0]], %[[VAL_1]] len %[[VAL_2]] : (!fir.ref<!fir.char<1,10>>, !fir.ref<!fir.char<1,20>>, index) -> !hlfir.expr<!fir.char<1,30>>


func.func @concat_boxchar(%arg0: !fir.boxchar<1>, %arg1: !fir.boxchar<1>) {
  %c30 = arith.constant 30 : index
  %0 = hlfir.concat %arg0, %arg1 len %c30 : (!fir.boxchar<1>, !fir.boxchar<1>, index) -> (!hlfir.expr<!fir.char<1,?>>)
  return
}
// CHECK-LABEL:   func.func @concat_boxchar(
// CHECK-SAME:    %[[VAL_0:.*]]: !fir.boxchar<1>,
// CHECK-SAME:    %[[VAL_1:.*]]: !fir.boxchar<1>) {
// CHECK:  %[[VAL_2:.*]] = arith.constant 30 : index
// CHECK:  %[[VAL_3:.*]] = hlfir.concat %[[VAL_0]], %[[VAL_1]] len %[[VAL_2]] : (!fir.boxchar<1>, !fir.boxchar<1>, index) -> !hlfir.expr<!fir.char<1,?>>


func.func @concat_boxchar_kind2(%arg0: !fir.boxchar<2>, %arg1: !fir.boxchar<2>) {
  %c30 = arith.constant 30 : index
  %0 = hlfir.concat %arg0, %arg1 len %c30 : (!fir.boxchar<2>, !fir.boxchar<2>, index) -> (!hlfir.expr<!fir.char<2,?>>)
  return
}
// CHECK-LABEL:   func.func @concat_boxchar_kind2(
// CHECK-SAME:    %[[VAL_0:.*]]: !fir.boxchar<2>,
// CHECK-SAME:    %[[VAL_1:.*]]: !fir.boxchar<2>) {
// CHECK:  %[[VAL_2:.*]] = arith.constant 30 : index
// CHECK:  %[[VAL_3:.*]] = hlfir.concat %[[VAL_0]], %[[VAL_1]] len %[[VAL_2]] : (!fir.boxchar<2>, !fir.boxchar<2>, index) -> !hlfir.expr<!fir.char<2,?>>


func.func @concat_expr(%arg0: !hlfir.expr<!fir.char<1,10>>, %arg1: !hlfir.expr<!fir.char<1,20>>) {
  %c30 = arith.constant 30 : index
  %0 = hlfir.concat %arg0, %arg1 len %c30 : (!hlfir.expr<!fir.char<1,10>>, !hlfir.expr<!fir.char<1,20>>, index) -> (!hlfir.expr<!fir.char<1,30>>)
  return
}
// CHECK-LABEL:   func.func @concat_expr(
// CHECK-SAME:    %[[VAL_0:.*]]: !hlfir.expr<!fir.char<1,10>>,
// CHECK-SAME:    %[[VAL_1:.*]]: !hlfir.expr<!fir.char<1,20>>) {
// CHECK:  %[[VAL_2:.*]] = arith.constant 30 : index
// CHECK:  %[[VAL_3:.*]] = hlfir.concat %[[VAL_0]], %[[VAL_1]] len %[[VAL_2]] : (!hlfir.expr<!fir.char<1,10>>, !hlfir.expr<!fir.char<1,20>>, index) -> !hlfir.expr<!fir.char<1,30>>


func.func @concat_several_args(%arg0: !fir.boxchar<1>, %arg1: !fir.boxchar<1>) {
  %c30 = arith.constant 30 : index
  %0 = hlfir.concat %arg0, %arg1, %arg1 len %c30 : (!fir.boxchar<1>, !fir.boxchar<1>, !fir.boxchar<1>, index) -> (!hlfir.expr<!fir.char<1,?>>)
  return
}
// CHECK-LABEL:   func.func @concat_several_args(
// CHECK-SAME:    %[[VAL_0:.*]]: !fir.boxchar<1>,
// CHECK-SAME:    %[[VAL_1:.*]]: !fir.boxchar<1>) {
// CHECK:  %[[VAL_2:.*]] = arith.constant 30 : index
// CHECK:  %[[VAL_3:.*]] = hlfir.concat %[[VAL_0]], %[[VAL_1]], %[[VAL_1]] len %[[VAL_2]] : (!fir.boxchar<1>, !fir.boxchar<1>, !fir.boxchar<1>, index) -> !hlfir.expr<!fir.char<1,?>>