2
2
// Exceptions. See /LICENSE for license information.
3
3
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
4
//
5
+ // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/primitives.carbon
6
+ //
5
7
// AUTOUPDATE
6
8
// TIP: To test this file alone, run:
7
9
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/array/base.carbon
@@ -19,10 +21,10 @@ fn Run() {
19
21
// CHECK:STDOUT: ; ModuleID = 'base.carbon'
20
22
// CHECK:STDOUT: source_filename = "base.carbon"
21
23
// CHECK:STDOUT:
22
- // CHECK:STDOUT: @array.237.loc12_3 = internal constant [1 x i32] [i32 1]
23
- // CHECK:STDOUT: @array.6a2.loc13_3 = internal constant [2 x double] [double 0x4026333333333334, double 2.200000e+00]
24
- // CHECK:STDOUT: @array.1cb.loc14_3 = internal constant [5 x {}] zeroinitializer
25
- // CHECK:STDOUT: @tuple.loc15_3 = internal constant { i32, i32, i32 } { i32 1, i32 2, i32 3 }
24
+ // CHECK:STDOUT: @array.237.loc14_3 = internal constant [1 x i32] [i32 1]
25
+ // CHECK:STDOUT: @array.6a2.loc15_3 = internal constant [2 x double] [double 0x4026333333333334, double 2.200000e+00]
26
+ // CHECK:STDOUT: @array.1cb.loc16_3 = internal constant [5 x {}] zeroinitializer
27
+ // CHECK:STDOUT: @tuple.loc17_3 = internal constant { i32, i32, i32 } { i32 1, i32 2, i32 3 }
26
28
// CHECK:STDOUT:
27
29
// CHECK:STDOUT: define void @main() !dbg !4 {
28
30
// CHECK:STDOUT: entry:
@@ -32,37 +34,37 @@ fn Run() {
32
34
// CHECK:STDOUT: %d.var = alloca { i32, i32, i32 }, align 8, !dbg !10
33
35
// CHECK:STDOUT: %e.var = alloca [3 x i32], align 4, !dbg !11
34
36
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 4, ptr %a.var), !dbg !7
35
- // CHECK:STDOUT: %.loc12_29 .3.array.index = getelementptr inbounds [1 x i32], ptr %a.var, i32 0, i64 0, !dbg !12
36
- // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %a.var, ptr align 4 @array.237.loc12_3 , i64 4, i1 false), !dbg !7
37
+ // CHECK:STDOUT: %.loc14_29 .3.array.index = getelementptr inbounds [1 x i32], ptr %a.var, i32 0, i64 0, !dbg !12
38
+ // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %a.var, ptr align 4 @array.237.loc14_3 , i64 4, i1 false), !dbg !7
37
39
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 16, ptr %b.var), !dbg !8
38
- // CHECK:STDOUT: %.loc13_37 .2.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, i64 0, !dbg !13
39
- // CHECK:STDOUT: %.loc13_37 .4.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, i64 1, !dbg !13
40
- // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %b.var, ptr align 8 @array.6a2.loc13_3 , i64 16, i1 false), !dbg !8
40
+ // CHECK:STDOUT: %.loc15_37 .2.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, i64 0, !dbg !13
41
+ // CHECK:STDOUT: %.loc15_37 .4.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, i64 1, !dbg !13
42
+ // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %b.var, ptr align 8 @array.6a2.loc15_3 , i64 16, i1 false), !dbg !8
41
43
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 0, ptr %c.var), !dbg !9
42
- // CHECK:STDOUT: %.loc14_45 .2.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 0, !dbg !14
43
- // CHECK:STDOUT: %.loc14_45 .4.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 1, !dbg !14
44
- // CHECK:STDOUT: %.loc14_45 .6.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 2, !dbg !14
45
- // CHECK:STDOUT: %.loc14_45 .8.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 3, !dbg !14
46
- // CHECK:STDOUT: %.loc14_45 .10.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 4, !dbg !14
47
- // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @array.1cb.loc14_3 , i64 0, i1 false), !dbg !9
44
+ // CHECK:STDOUT: %.loc16_45 .2.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 0, !dbg !14
45
+ // CHECK:STDOUT: %.loc16_45 .4.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 1, !dbg !14
46
+ // CHECK:STDOUT: %.loc16_45 .6.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 2, !dbg !14
47
+ // CHECK:STDOUT: %.loc16_45 .8.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 3, !dbg !14
48
+ // CHECK:STDOUT: %.loc16_45 .10.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 4, !dbg !14
49
+ // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %c.var, ptr align 1 @array.1cb.loc16_3 , i64 0, i1 false), !dbg !9
48
50
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 12, ptr %d.var), !dbg !10
49
- // CHECK:STDOUT: %tuple.elem0.loc15 .tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 0, !dbg !15
50
- // CHECK:STDOUT: %tuple.elem1.loc15 .tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 1, !dbg !15
51
- // CHECK:STDOUT: %tuple.elem2.loc15 .tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 2, !dbg !15
52
- // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %d.var, ptr align 4 @tuple.loc15_3 , i64 12, i1 false), !dbg !10
51
+ // CHECK:STDOUT: %tuple.elem0.loc17 .tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 0, !dbg !15
52
+ // CHECK:STDOUT: %tuple.elem1.loc17 .tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 1, !dbg !15
53
+ // CHECK:STDOUT: %tuple.elem2.loc17 .tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 2, !dbg !15
54
+ // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %d.var, ptr align 4 @tuple.loc17_3 , i64 12, i1 false), !dbg !10
53
55
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 12, ptr %e.var), !dbg !11
54
- // CHECK:STDOUT: %tuple.elem0.loc16 .tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 0, !dbg !16
55
- // CHECK:STDOUT: %.loc16_26 .1 = load i32, ptr %tuple.elem0.loc16 .tuple.elem, align 4, !dbg !16
56
- // CHECK:STDOUT: %.loc16_26 .2.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i64 0, !dbg !16
57
- // CHECK:STDOUT: store i32 %.loc16_26 .1, ptr %.loc16_26 .2.array.index, align 4, !dbg !16
58
- // CHECK:STDOUT: %tuple.elem1.loc16 .tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 1, !dbg !16
59
- // CHECK:STDOUT: %.loc16_26 .4 = load i32, ptr %tuple.elem1.loc16 .tuple.elem, align 4, !dbg !16
60
- // CHECK:STDOUT: %.loc16_26 .5.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i64 1, !dbg !16
61
- // CHECK:STDOUT: store i32 %.loc16_26 .4, ptr %.loc16_26 .5.array.index, align 4, !dbg !16
62
- // CHECK:STDOUT: %tuple.elem2.loc16 .tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 2, !dbg !16
63
- // CHECK:STDOUT: %.loc16_26 .7 = load i32, ptr %tuple.elem2.loc16 .tuple.elem, align 4, !dbg !16
64
- // CHECK:STDOUT: %.loc16_26 .8.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i64 2, !dbg !16
65
- // CHECK:STDOUT: store i32 %.loc16_26 .7, ptr %.loc16_26 .8.array.index, align 4, !dbg !16
56
+ // CHECK:STDOUT: %tuple.elem0.loc18 .tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 0, !dbg !16
57
+ // CHECK:STDOUT: %.loc18_26 .1 = load i32, ptr %tuple.elem0.loc18 .tuple.elem, align 4, !dbg !16
58
+ // CHECK:STDOUT: %.loc18_26 .2.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i64 0, !dbg !16
59
+ // CHECK:STDOUT: store i32 %.loc18_26 .1, ptr %.loc18_26 .2.array.index, align 4, !dbg !16
60
+ // CHECK:STDOUT: %tuple.elem1.loc18 .tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 1, !dbg !16
61
+ // CHECK:STDOUT: %.loc18_26 .4 = load i32, ptr %tuple.elem1.loc18 .tuple.elem, align 4, !dbg !16
62
+ // CHECK:STDOUT: %.loc18_26 .5.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i64 1, !dbg !16
63
+ // CHECK:STDOUT: store i32 %.loc18_26 .4, ptr %.loc18_26 .5.array.index, align 4, !dbg !16
64
+ // CHECK:STDOUT: %tuple.elem2.loc18 .tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %d.var, i32 0, i32 2, !dbg !16
65
+ // CHECK:STDOUT: %.loc18_26 .7 = load i32, ptr %tuple.elem2.loc18 .tuple.elem, align 4, !dbg !16
66
+ // CHECK:STDOUT: %.loc18_26 .8.array.index = getelementptr inbounds [3 x i32], ptr %e.var, i32 0, i64 2, !dbg !16
67
+ // CHECK:STDOUT: store i32 %.loc18_26 .7, ptr %.loc18_26 .8.array.index, align 4, !dbg !16
66
68
// CHECK:STDOUT: ret void, !dbg !17
67
69
// CHECK:STDOUT: }
68
70
// CHECK:STDOUT:
@@ -86,17 +88,17 @@ fn Run() {
86
88
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
87
89
// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
88
90
// CHECK:STDOUT: !3 = !DIFile(filename: "base.carbon", directory: "")
89
- // CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !3, line: 11 , type: !5, spFlags: DISPFlagDefinition, unit: !2)
91
+ // CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !3, line: 13 , type: !5, spFlags: DISPFlagDefinition, unit: !2)
90
92
// CHECK:STDOUT: !5 = !DISubroutineType(types: !6)
91
93
// CHECK:STDOUT: !6 = !{}
92
- // CHECK:STDOUT: !7 = !DILocation(line: 12 , column: 3, scope: !4)
93
- // CHECK:STDOUT: !8 = !DILocation(line: 13 , column: 3, scope: !4)
94
- // CHECK:STDOUT: !9 = !DILocation(line: 14 , column: 3, scope: !4)
95
- // CHECK:STDOUT: !10 = !DILocation(line: 15 , column: 3, scope: !4)
96
- // CHECK:STDOUT: !11 = !DILocation(line: 16 , column: 3, scope: !4)
97
- // CHECK:STDOUT: !12 = !DILocation(line: 12 , column: 26, scope: !4)
98
- // CHECK:STDOUT: !13 = !DILocation(line: 13 , column: 26, scope: !4)
99
- // CHECK:STDOUT: !14 = !DILocation(line: 14 , column: 25, scope: !4)
100
- // CHECK:STDOUT: !15 = !DILocation(line: 15 , column: 28, scope: !4)
101
- // CHECK:STDOUT: !16 = !DILocation(line: 16 , column: 26, scope: !4)
102
- // CHECK:STDOUT: !17 = !DILocation(line: 11 , column: 1, scope: !4)
94
+ // CHECK:STDOUT: !7 = !DILocation(line: 14 , column: 3, scope: !4)
95
+ // CHECK:STDOUT: !8 = !DILocation(line: 15 , column: 3, scope: !4)
96
+ // CHECK:STDOUT: !9 = !DILocation(line: 16 , column: 3, scope: !4)
97
+ // CHECK:STDOUT: !10 = !DILocation(line: 17 , column: 3, scope: !4)
98
+ // CHECK:STDOUT: !11 = !DILocation(line: 18 , column: 3, scope: !4)
99
+ // CHECK:STDOUT: !12 = !DILocation(line: 14 , column: 26, scope: !4)
100
+ // CHECK:STDOUT: !13 = !DILocation(line: 15 , column: 26, scope: !4)
101
+ // CHECK:STDOUT: !14 = !DILocation(line: 16 , column: 25, scope: !4)
102
+ // CHECK:STDOUT: !15 = !DILocation(line: 17 , column: 28, scope: !4)
103
+ // CHECK:STDOUT: !16 = !DILocation(line: 18 , column: 26, scope: !4)
104
+ // CHECK:STDOUT: !17 = !DILocation(line: 13 , column: 1, scope: !4)
0 commit comments