mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Require file tests to specify a min-prelude (#5818)
Use `full.carbon` min-prelude for any tests using the full prelude. A few tests were using it unnecessarily and are changed to a more minimal one in the process. Any test which does not include some min-prelude will now fail with an error.
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/function/generic/call_different_specific.carbon
|
||||
@@ -57,10 +59,10 @@ fn M() {
|
||||
// CHECK:STDOUT: %ptr_f64.var = alloca ptr, align 8, !dbg !8
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %ptr_i32.var), !dbg !7
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(i64 8, ptr %ptr_f64.var), !dbg !8
|
||||
// CHECK:STDOUT: %.loc44 = load ptr, ptr %ptr_i32.var, align 8, !dbg !9
|
||||
// CHECK:STDOUT: call void @_CF.Main.b88d1103f417c6d4(ptr %.loc44), !dbg !10
|
||||
// CHECK:STDOUT: %.loc45 = load ptr, ptr %ptr_f64.var, align 8, !dbg !11
|
||||
// CHECK:STDOUT: call void @_CF.Main.66be507887ceee78(ptr %.loc45), !dbg !12
|
||||
// CHECK:STDOUT: %.loc46 = load ptr, ptr %ptr_i32.var, align 8, !dbg !9
|
||||
// CHECK:STDOUT: call void @_CF.Main.b88d1103f417c6d4(ptr %.loc46), !dbg !10
|
||||
// CHECK:STDOUT: %.loc47 = load ptr, ptr %ptr_f64.var, align 8, !dbg !11
|
||||
// CHECK:STDOUT: call void @_CF.Main.66be507887ceee78(ptr %.loc47), !dbg !12
|
||||
// CHECK:STDOUT: ret void, !dbg !13
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -88,15 +90,15 @@ fn M() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: define linkonce_odr void @_CB.Main.b88d1103f417c6d4(ptr %x) !dbg !24 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc32_5.2 = load i32, ptr %x, align 4, !dbg !25
|
||||
// CHECK:STDOUT: %D.call = call i32 @_CD.Main.b88d1103f417c6d4(i32 %.loc32_5.2), !dbg !26
|
||||
// CHECK:STDOUT: %.loc34_5.2 = load i32, ptr %x, align 4, !dbg !25
|
||||
// CHECK:STDOUT: %D.call = call i32 @_CD.Main.b88d1103f417c6d4(i32 %.loc34_5.2), !dbg !26
|
||||
// CHECK:STDOUT: ret void, !dbg !27
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: define linkonce_odr void @_CB.Main.66be507887ceee78(ptr %x) !dbg !28 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc32_5.2 = load double, ptr %x, align 8, !dbg !29
|
||||
// CHECK:STDOUT: %D.call = call double @_CD.Main.66be507887ceee78(double %.loc32_5.2), !dbg !30
|
||||
// CHECK:STDOUT: %.loc34_5.2 = load double, ptr %x, align 8, !dbg !29
|
||||
// CHECK:STDOUT: %D.call = call double @_CD.Main.66be507887ceee78(double %.loc34_5.2), !dbg !30
|
||||
// CHECK:STDOUT: ret void, !dbg !31
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -123,35 +125,35 @@ fn M() {
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !3 = !DIFile(filename: "call_different_specific.carbon", directory: "")
|
||||
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !3, line: 40, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "M", linkageName: "_CM.Main", scope: null, file: !3, line: 42, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !5 = !DISubroutineType(types: !6)
|
||||
// CHECK:STDOUT: !6 = !{}
|
||||
// CHECK:STDOUT: !7 = !DILocation(line: 41, column: 3, scope: !4)
|
||||
// CHECK:STDOUT: !8 = !DILocation(line: 42, column: 3, scope: !4)
|
||||
// CHECK:STDOUT: !9 = !DILocation(line: 44, column: 5, scope: !4)
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 44, column: 3, scope: !4)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 45, column: 5, scope: !4)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 45, column: 3, scope: !4)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 40, column: 1, scope: !4)
|
||||
// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.b88d1103f417c6d4", scope: null, file: !3, line: 35, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 36, column: 3, scope: !14)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 37, column: 3, scope: !14)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 35, column: 1, scope: !14)
|
||||
// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.66be507887ceee78", scope: null, file: !3, line: 35, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 36, column: 3, scope: !18)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 37, column: 3, scope: !18)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 35, column: 1, scope: !18)
|
||||
// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.5754c7a55c7cbe4a", scope: null, file: !3, line: 23, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 24, column: 3, scope: !22)
|
||||
// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.b88d1103f417c6d4", scope: null, file: !3, line: 31, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 32, column: 5, scope: !24)
|
||||
// CHECK:STDOUT: !26 = !DILocation(line: 32, column: 3, scope: !24)
|
||||
// CHECK:STDOUT: !27 = !DILocation(line: 31, column: 1, scope: !24)
|
||||
// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.66be507887ceee78", scope: null, file: !3, line: 31, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !29 = !DILocation(line: 32, column: 5, scope: !28)
|
||||
// CHECK:STDOUT: !30 = !DILocation(line: 32, column: 3, scope: !28)
|
||||
// CHECK:STDOUT: !31 = !DILocation(line: 31, column: 1, scope: !28)
|
||||
// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.b88d1103f417c6d4", scope: null, file: !3, line: 27, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !33 = !DILocation(line: 28, column: 3, scope: !32)
|
||||
// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.66be507887ceee78", scope: null, file: !3, line: 27, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !35 = !DILocation(line: 28, column: 3, scope: !34)
|
||||
// CHECK:STDOUT: !7 = !DILocation(line: 43, column: 3, scope: !4)
|
||||
// CHECK:STDOUT: !8 = !DILocation(line: 44, column: 3, scope: !4)
|
||||
// CHECK:STDOUT: !9 = !DILocation(line: 46, column: 5, scope: !4)
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 46, column: 3, scope: !4)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 47, column: 5, scope: !4)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 47, column: 3, scope: !4)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 42, column: 1, scope: !4)
|
||||
// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.b88d1103f417c6d4", scope: null, file: !3, line: 37, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 38, column: 3, scope: !14)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 39, column: 3, scope: !14)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 37, column: 1, scope: !14)
|
||||
// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.66be507887ceee78", scope: null, file: !3, line: 37, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 38, column: 3, scope: !18)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 39, column: 3, scope: !18)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 37, column: 1, scope: !18)
|
||||
// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main.5754c7a55c7cbe4a", scope: null, file: !3, line: 25, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 26, column: 3, scope: !22)
|
||||
// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.b88d1103f417c6d4", scope: null, file: !3, line: 33, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 34, column: 5, scope: !24)
|
||||
// CHECK:STDOUT: !26 = !DILocation(line: 34, column: 3, scope: !24)
|
||||
// CHECK:STDOUT: !27 = !DILocation(line: 33, column: 1, scope: !24)
|
||||
// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main.66be507887ceee78", scope: null, file: !3, line: 33, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !29 = !DILocation(line: 34, column: 5, scope: !28)
|
||||
// CHECK:STDOUT: !30 = !DILocation(line: 34, column: 3, scope: !28)
|
||||
// CHECK:STDOUT: !31 = !DILocation(line: 33, column: 1, scope: !28)
|
||||
// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.b88d1103f417c6d4", scope: null, file: !3, line: 29, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !33 = !DILocation(line: 30, column: 3, scope: !32)
|
||||
// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "D", linkageName: "_CD.Main.66be507887ceee78", scope: null, file: !3, line: 29, type: !5, spFlags: DISPFlagDefinition, unit: !2)
|
||||
// CHECK:STDOUT: !35 = !DILocation(line: 30, column: 3, scope: !34)
|
||||
|
||||
Reference in New Issue
Block a user