File: fir-types.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 (125 lines) | stat: -rw-r--r-- 5,955 bytes parent folder | download | duplicates (8)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// Test the FIR types
// Parse types and check that we can reparse what we print.
// RUN: fir-opt --split-input-file %s | fir-opt --split-input-file | FileCheck %s

// Fortran Intrinsic types
// CHECK-LABEL: func private @it1() -> !fir.int<4>
// CHECK-LABEL: func private @it2() -> !fir.real<8>
// CHECK-LABEL: func private @it3() -> !fir.complex<8>
// CHECK-LABEL: func private @it4() -> !fir.logical<1>
// CHECK-LABEL: func private @it5() -> !fir.char<1>
// CHECK-LABEL: func private @it6() -> !fir.char<2,10>
// CHECK-LABEL: func private @it7() -> !fir.char<4,?>
func.func private @it1() -> !fir.int<4>
func.func private @it2() -> !fir.real<8>
func.func private @it3() -> !fir.complex<8>
func.func private @it4() -> !fir.logical<1>
func.func private @it5() -> !fir.char<1>
func.func private @it6() -> !fir.char<2,10>
func.func private @it7() -> !fir.char<4,?>

// -----

// Fortran Derived types (records)
// CHECK-LABEL: func private @dvd1() -> !fir.type<derived1>
// CHECK-LABEL: func private @dvd2() -> !fir.type<derived2(p:i32)>
// CHECK-LABEL: func private @dvd3() -> !fir.type<derived3{f:f32}>
// CHECK-LABEL: func private @dvd4() -> !fir.type<derived4(p:i8){f:f32}>
// CHECK-LABEL: func private @dvd5() -> !fir.type<derived5(p1:i8,p2:i8,p3:i8,p4:i8,p5:i8){f1:f32,f2:f32,f3:f32,f4:f32,f5:f32,f6:f32,f7:f32,f8:f32}>
// CHECK-LABEL: func private @dvd6() -> !fir.type<derived6{f:!fir.ptr<!fir.type<derived6>>}>
// CHECK-LABEL: func private @dvd7() -> !fir.type<derived_with_field_name_same_as_integer_type{i32:f32}>
func.func private @dvd1() -> !fir.type<derived1>
func.func private @dvd2() -> !fir.type<derived2(p:i32)>
func.func private @dvd3() -> !fir.type<derived3{f:f32}>
func.func private @dvd4() -> !fir.type<derived4(p:i8){f:f32}>
func.func private @dvd5() -> !fir.type<derived5(p1:i8,p2:i8,p3:i8,p4:i8,p5:i8){f1:f32,f2:f32,f3:f32,f4:f32,f5:f32,f6:f32,f7:f32,f8:f32}>
func.func private @dvd6() -> !fir.type<derived6{f:!fir.ptr<!fir.type<derived6>>}>
func.func private @dvd7() -> !fir.type<derived_with_field_name_same_as_integer_type{i32:f32}>

// -----

// FIR array types
// CHECK-LABEL: func private @arr1() -> !fir.array<10xf32>
// CHECK-LABEL: func private @arr2() -> !fir.array<10x10xf32>
// CHECK-LABEL: func private @arr3() -> !fir.array<?xf32>
// CHECK-LABEL: func private @arr4() -> !fir.array<10x?xf32>
// CHECK-LABEL: func private @arr5() -> !fir.array<?x?xf32>
// CHECK-LABEL: func private @arr6() -> !fir.array<*:f32>
// CHECK-LABEL: func private @arr7() -> !fir.array<1x2x?x4x5x6x7x8x9xf32>
func.func private @arr1() -> !fir.array<10xf32>
func.func private @arr2() -> !fir.array<10x10xf32>
func.func private @arr3() -> !fir.array<?xf32>
func.func private @arr4() -> !fir.array<10x?xf32>
func.func private @arr5() -> !fir.array<?x?xf32>
func.func private @arr6() -> !fir.array<*:f32>
func.func private @arr7() -> !fir.array<1x2x?x4x5x6x7x8x9xf32>

// -----

// FIR pointer-like types
// CHECK-LABEL: func private @mem1() -> !fir.ref<i32>
// CHECK-LABEL: func private @mem2() -> !fir.ptr<i32>
// CHECK-LABEL: func private @mem3() -> !fir.heap<i32>
// CHECK-LABEL: func private @mem4() -> !fir.ref<() -> ()>
// CHECK-LABEL: func private @mem5() -> !fir.llvm_ptr<!fir.ref<f32>>
// CHECK-LABEL: func private @mem6() -> !fir.llvm_ptr<i8>
func.func private @mem1() -> !fir.ref<i32>
func.func private @mem2() -> !fir.ptr<i32>
func.func private @mem3() -> !fir.heap<i32>
func.func private @mem4() -> !fir.ref<() -> ()>
func.func private @mem5() -> !fir.llvm_ptr<!fir.ref<f32>>
func.func private @mem6() -> !fir.llvm_ptr<i8>

// -----

// FIR box types (descriptors)
// CHECK-LABEL: func private @box1() -> !fir.box<!fir.array<?xf32>>
// CHECK-LABEL: func private @box2() -> !fir.boxchar<2>
// CHECK-LABEL: func private @box3() -> !fir.boxproc<(i32, i32) -> i64>
// CHECK-LABEL: func private @box4() -> !fir.box<none>
// CHECK-LABEL: func private @box5() -> !fir.box<!fir.type<derived3{f:f32}>>
func.func private @box1() -> !fir.box<!fir.array<?xf32>>
func.func private @box2() -> !fir.boxchar<2>
func.func private @box3() -> !fir.boxproc<(i32, i32) -> i64>
func.func private @box4() -> !fir.box<none>
func.func private @box5() -> !fir.box<!fir.type<derived3{f:f32}>>

// -----

// FIR misc. types
// CHECK-LABEL: func private @oth1() -> !fir.shape<1>
// CHECK-LABEL: func private @oth2() -> !fir.field
// CHECK-LABEL: func private @oth3() -> !fir.tdesc<!fir.type<derived7{f1:f32,f2:f32}>>
// CHECK-LABEL: func private @oth4() -> !fir.shapeshift<15>
// CHECK-LABEL: func private @oth5() -> !fir.slice<8>
func.func private @oth1() -> !fir.shape<1>
func.func private @oth2() -> !fir.field
func.func private @oth3() -> !fir.tdesc<!fir.type<derived7{f1:f32,f2:f32}>>
func.func private @oth4() -> !fir.shapeshift<15>
func.func private @oth5() -> !fir.slice<8>

// -----

// FIR vector
// CHECK-LABEL: func private @vecty(i1) -> !fir.vector<10:i32>
func.func private @vecty(i1) -> !fir.vector<10:i32>

// -----

// FIR Class type
// CHECK-LABEL: class1() -> !fir.class<!fir.type<c1{p:i32}>>
// CHECK-LABEL: class2() -> !fir.class<!fir.array<?x!fir.type<c1{p:i32}>>>
// CHECK-LABEL: class3() -> !fir.class<!fir.heap<!fir.type<c1{p:i32}>>>
// CHECK-LABEL: class4() -> !fir.class<!fir.ptr<!fir.type<c1{p:i32}>>>
// CHECK-LABEL: class5() -> !fir.class<none>
// CHECK-LABEL: class6() -> !fir.class<!fir.array<?xnone>>
// CHECK-LABEL: class7() -> !fir.class<!fir.heap<none>>
// CHECK-LABEL: class8() -> !fir.class<!fir.ptr<none>>
func.func private @class1() -> !fir.class<!fir.type<c1{p:i32}>>
func.func private @class2() -> !fir.class<!fir.array<?x!fir.type<c1{p:i32}>>>
func.func private @class3() -> !fir.class<!fir.heap<!fir.type<c1{p:i32}>>>
func.func private @class4() -> !fir.class<!fir.ptr<!fir.type<c1{p:i32}>>>
func.func private @class5() -> !fir.class<none>
func.func private @class6() -> !fir.class<!fir.array<?xnone>>
func.func private @class7() -> !fir.class<!fir.heap<none>>
func.func private @class8() -> !fir.class<!fir.ptr<none>>