mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 16:01:05 +01:00
Reorganize lower interop tests. (#7327)
Split existing class and function tests into
`{class,function}/{import,export}` as appropriate. Remove the now-empty
`reverse/` directory.
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/function/import/cpp_run.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/function/import/cpp_run.carbon
|
||||
|
||||
// --- carbon_run.carbon
|
||||
|
||||
import Cpp inline '''
|
||||
namespace N {
|
||||
void Run() {}
|
||||
}
|
||||
''';
|
||||
|
||||
fn Run() {
|
||||
Cpp.N.Run();
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: ; ModuleID = 'carbon_run.carbon'
|
||||
// CHECK:STDOUT: source_filename = "carbon_run.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define dso_local void @_ZN1N3RunEv() #0 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @main() #1 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_ZN1N3RunEv(), !dbg !15
|
||||
// CHECK:STDOUT: ret i32 0, !dbg !16
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #1 = { nounwind }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "carbon_run.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !6, line: 8, type: !12, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !12 = !DISubroutineType(types: !13)
|
||||
// CHECK:STDOUT: !13 = !{!14}
|
||||
// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 9, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 8, column: 1, scope: !11)
|
||||
@@ -0,0 +1,494 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/function/import/function_decl.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/function/import/function_decl.carbon
|
||||
|
||||
// ============================================================================
|
||||
// function_decl
|
||||
// ============================================================================
|
||||
|
||||
// --- function_decl.h
|
||||
|
||||
void foo();
|
||||
|
||||
// --- import_function_decl.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "function_decl.h";
|
||||
|
||||
fn MyF() {
|
||||
Cpp.foo();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// inline_function_decl
|
||||
// ============================================================================
|
||||
|
||||
// --- inline_function_decl.h
|
||||
|
||||
inline void foo() {}
|
||||
|
||||
// --- import_inline_function_decl.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "inline_function_decl.h";
|
||||
|
||||
fn MyF() {
|
||||
Cpp.foo();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// inline_used_function_decl
|
||||
// ============================================================================
|
||||
|
||||
// --- inline_used_function_decl.h
|
||||
|
||||
inline __attribute__((used)) void foo() {}
|
||||
|
||||
// --- import_inline_used_function_decl.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "inline_used_function_decl.h";
|
||||
|
||||
fn MyF() {
|
||||
Cpp.foo();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// multiple_inline_function_decls
|
||||
// ============================================================================
|
||||
|
||||
// --- multiple_inline_function_decls.h
|
||||
|
||||
inline void foo1() {}
|
||||
inline void foo2() {}
|
||||
inline void foo3() {}
|
||||
|
||||
// --- import_multiple_inline_function_decls.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "multiple_inline_function_decls.h";
|
||||
|
||||
fn MyF() {
|
||||
Cpp.foo1();
|
||||
Cpp.foo2();
|
||||
Cpp.foo3();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// inline_recursive_function_decl
|
||||
// ============================================================================
|
||||
|
||||
// --- inline_recursive_function_decl.h
|
||||
|
||||
inline void foo1() {}
|
||||
inline void foo2() { foo1(); }
|
||||
|
||||
// --- import_inline_recursive_function_decl.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "inline_recursive_function_decl.h";
|
||||
|
||||
fn MyF() {
|
||||
// This should generate the definition of the inline function `foo1()`.
|
||||
Cpp.foo2();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Default arguments
|
||||
// ============================================================================
|
||||
|
||||
// --- with_default_args.h
|
||||
|
||||
void NoReturnValue(int a = 1, int b = 2);
|
||||
int SimpleReturnValue(int a = 1, int b = 2);
|
||||
|
||||
// --- call_with_default_args.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "with_default_args.h";
|
||||
|
||||
fn MyF() -> i32 {
|
||||
Cpp.NoReturnValue();
|
||||
Cpp.NoReturnValue(3);
|
||||
Cpp.NoReturnValue(3, 4);
|
||||
|
||||
var value: i32 = Cpp.SimpleReturnValue();
|
||||
value = Cpp.SimpleReturnValue(3);
|
||||
value = Cpp.SimpleReturnValue(3, 4);
|
||||
return value;
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_function_decl.carbon'
|
||||
// CHECK:STDOUT: source_filename = "import_function_decl.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z3foov(), !dbg !14
|
||||
// CHECK:STDOUT: ret void, !dbg !15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z3foov() #1
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_function_decl.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !12 = !DISubroutineType(types: !13)
|
||||
// CHECK:STDOUT: !13 = !{null}
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !11)
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_inline_function_decl.carbon'
|
||||
// CHECK:STDOUT: source_filename = "import_inline_function_decl.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z3foov = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z3foov(), !dbg !14
|
||||
// CHECK:STDOUT: ret void, !dbg !15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z3foov() #1 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_inline_function_decl.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !12 = !DISubroutineType(types: !13)
|
||||
// CHECK:STDOUT: !13 = !{null}
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !11)
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_inline_used_function_decl.carbon'
|
||||
// CHECK:STDOUT: source_filename = "import_inline_used_function_decl.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z3foov = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: @llvm.compiler.used = appending global [1 x ptr] [ptr @_Z3foov], section "llvm.metadata"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z3foov() #0 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CMyF.Main() #1 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z3foov(), !dbg !14
|
||||
// CHECK:STDOUT: ret void, !dbg !15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @_Z3foov, { 1, 0 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #1 = { nounwind }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_inline_used_function_decl.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !12 = !DISubroutineType(types: !13)
|
||||
// CHECK:STDOUT: !13 = !{null}
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !11)
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_multiple_inline_function_decls.carbon'
|
||||
// CHECK:STDOUT: source_filename = "import_multiple_inline_function_decls.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z4foo1v = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z4foo2v = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z4foo3v = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4foo1v(), !dbg !14
|
||||
// CHECK:STDOUT: call void @_Z4foo2v(), !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z4foo3v(), !dbg !16
|
||||
// CHECK:STDOUT: ret void, !dbg !17
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z4foo1v() #1 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z4foo2v() #1 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z4foo3v() #1 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_multiple_inline_function_decls.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !12 = !DISubroutineType(types: !13)
|
||||
// CHECK:STDOUT: !13 = !{null}
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 8, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 9, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 6, column: 1, scope: !11)
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_inline_recursive_function_decl.carbon'
|
||||
// CHECK:STDOUT: source_filename = "import_inline_recursive_function_decl.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z4foo2v = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_Z4foo1v = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4foo2v(), !dbg !14
|
||||
// CHECK:STDOUT: ret void, !dbg !15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z4foo2v() #1 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4foo1v()
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_Z4foo1v() #2 comdat {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_inline_recursive_function_decl.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !12 = !DISubroutineType(types: !13)
|
||||
// CHECK:STDOUT: !13 = !{null}
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 8, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !11)
|
||||
// CHECK:STDOUT: ; ModuleID = 'call_with_default_args.carbon'
|
||||
// CHECK:STDOUT: source_filename = "call_with_default_args.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CMyF.Main() #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %value.var = alloca i32, align 4, !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z13NoReturnValueii.carbon_thunk.(), !dbg !16
|
||||
// CHECK:STDOUT: call void @_Z13NoReturnValueii.carbon_thunk._(i32 3), !dbg !17
|
||||
// CHECK:STDOUT: call void @_Z13NoReturnValueii(i32 3, i32 4), !dbg !18
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %value.var), !dbg !15
|
||||
// CHECK:STDOUT: %SimpleReturnValue__carbon_thunk.call.loc11 = call i32 @_Z17SimpleReturnValueii.carbon_thunk.(), !dbg !19
|
||||
// CHECK:STDOUT: store i32 %SimpleReturnValue__carbon_thunk.call.loc11, ptr %value.var, align 4, !dbg !15
|
||||
// CHECK:STDOUT: %SimpleReturnValue__carbon_thunk.call.loc12 = call i32 @_Z17SimpleReturnValueii.carbon_thunk._(i32 3), !dbg !20
|
||||
// CHECK:STDOUT: store i32 %SimpleReturnValue__carbon_thunk.call.loc12, ptr %value.var, align 4, !dbg !21
|
||||
// CHECK:STDOUT: %SimpleReturnValue.call = call i32 @_Z17SimpleReturnValueii(i32 3, i32 4), !dbg !22
|
||||
// CHECK:STDOUT: store i32 %SimpleReturnValue.call, ptr %value.var, align 4, !dbg !23
|
||||
// CHECK:STDOUT: %.loc14 = load i32, ptr %value.var, align 4, !dbg !24
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %value.var), !dbg !15
|
||||
// CHECK:STDOUT: ret i32 %.loc14, !dbg !25
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z13NoReturnValueii.carbon_thunk.() #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z13NoReturnValueii(i32 noundef 1, i32 noundef 2)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z13NoReturnValueii.carbon_thunk._(i32 noundef %a) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %a.addr = alloca i32, align 4
|
||||
// CHECK:STDOUT: store i32 %a, ptr %a.addr, align 4, !tbaa !7
|
||||
// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !7
|
||||
// CHECK:STDOUT: call void @_Z13NoReturnValueii(i32 noundef %0, i32 noundef 2)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z13NoReturnValueii(i32 noundef, i32 noundef) #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef i32 @_Z17SimpleReturnValueii.carbon_thunk.() #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %call = call noundef i32 @_Z17SimpleReturnValueii(i32 noundef 1, i32 noundef 2)
|
||||
// CHECK:STDOUT: ret i32 %call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal noundef i32 @_Z17SimpleReturnValueii.carbon_thunk._(i32 noundef %a) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %a.addr = alloca i32, align 4
|
||||
// CHECK:STDOUT: store i32 %a, ptr %a.addr, align 4, !tbaa !7
|
||||
// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !7
|
||||
// CHECK:STDOUT: %call = call noundef i32 @_Z17SimpleReturnValueii(i32 noundef %0, i32 noundef 2)
|
||||
// CHECK:STDOUT: ret i32 %call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare noundef i32 @_Z17SimpleReturnValueii(i32 noundef, i32 noundef) #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !26 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !31
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @_Z13NoReturnValueii, { 2, 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @_Z17SimpleReturnValueii, { 2, 1, 0 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "call_with_default_args.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !12 = !DISubroutineType(types: !13)
|
||||
// CHECK:STDOUT: !13 = !{!14}
|
||||
// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 11, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 7, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 8, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 9, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 11, column: 20, scope: !11)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 12, column: 11, scope: !11)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 12, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 13, column: 11, scope: !11)
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 13, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 14, column: 10, scope: !11)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 14, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !6, line: 11, type: !27, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !29)
|
||||
// CHECK:STDOUT: !27 = !DISubroutineType(types: !28)
|
||||
// CHECK:STDOUT: !28 = !{null, !14}
|
||||
// CHECK:STDOUT: !29 = !{!30}
|
||||
// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !26, type: !14)
|
||||
// CHECK:STDOUT: !31 = !DILocation(line: 11, column: 3, scope: !26)
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/function/import/function_in_template.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/function/import/function_in_template.carbon
|
||||
|
||||
// --- class_template.h
|
||||
|
||||
template<typename T> struct X {
|
||||
static void f(T t) {}
|
||||
};
|
||||
|
||||
using Y = X<int>;
|
||||
|
||||
// --- use_class_template.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "class_template.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.Y.f(42);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: ; ModuleID = 'use_class_template.carbon'
|
||||
// CHECK:STDOUT: source_filename = "use_class_template.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: $_ZN1XIiE1fEi = comdat any
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_ZN1XIiE1fEi(i32 42), !dbg !14
|
||||
// CHECK:STDOUT: ret void, !dbg !15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1XIiE1fEi(i32 noundef %t) #1 comdat align 2 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %t.addr = alloca i32, align 4
|
||||
// CHECK:STDOUT: store i32 %t, ptr %t.addr, align 4, !tbaa !7
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "use_class_template.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !6, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !12 = !DISubroutineType(types: !13)
|
||||
// CHECK:STDOUT: !13 = !{null}
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 8, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !11)
|
||||
@@ -0,0 +1,98 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/function/import/import_inline.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/function/import/import_inline.carbon
|
||||
|
||||
import Cpp inline '''
|
||||
|
||||
void F(int *_Nonnull p) {
|
||||
*p = 1;
|
||||
}
|
||||
|
||||
''';
|
||||
|
||||
fn Call() -> i32 {
|
||||
var n: i32 = 0;
|
||||
Cpp.F(&n);
|
||||
return n;
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_inline.carbon'
|
||||
// CHECK:STDOUT: source_filename = "import_inline.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define dso_local void @_Z1FPi(ptr noundef %p) #0 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %p.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %p, ptr %p.addr, align 8, !tbaa !11
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %p.addr, align 8, !tbaa !11
|
||||
// CHECK:STDOUT: store i32 1, ptr %0, align 4, !tbaa !7
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CCall.Main() #1 !dbg !14 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !18
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !18
|
||||
// CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !18
|
||||
// CHECK:STDOUT: call void @_Z1FPi(ptr %n.var), !dbg !19
|
||||
// CHECK:STDOUT: %.loc24 = load i32, ptr %n.var, align 4, !dbg !20
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %n.var), !dbg !18
|
||||
// CHECK:STDOUT: ret i32 %.loc24, !dbg !21
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #1 !dbg !22 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !27
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #1 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_inline.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = !{!12, !12, i64 0}
|
||||
// CHECK:STDOUT: !12 = !{!"p1 int", !13, i64 0}
|
||||
// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0}
|
||||
// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !6, line: 21, type: !15, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !15 = !DISubroutineType(types: !16)
|
||||
// CHECK:STDOUT: !16 = !{!17}
|
||||
// CHECK:STDOUT: !17 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 22, column: 3, scope: !14)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 23, column: 3, scope: !14)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 24, column: 10, scope: !14)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 24, column: 3, scope: !14)
|
||||
// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !6, line: 22, type: !23, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !25)
|
||||
// CHECK:STDOUT: !23 = !DISubroutineType(types: !24)
|
||||
// CHECK:STDOUT: !24 = !{null, !17}
|
||||
// CHECK:STDOUT: !25 = !{!26}
|
||||
// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !22, type: !17)
|
||||
// CHECK:STDOUT: !27 = !DILocation(line: 22, column: 3, scope: !22)
|
||||
@@ -0,0 +1,583 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/primitives.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/function/import/parameters.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/function/import/parameters.carbon
|
||||
|
||||
// ============================================================================
|
||||
// Parameter requires a thunk to be generated
|
||||
// ============================================================================
|
||||
|
||||
// --- ints.h
|
||||
|
||||
// TODO: Also test `long long` once it's supported.
|
||||
|
||||
void pass_signed(signed char, short, int, long);
|
||||
|
||||
void pass_unsigned(unsigned char, unsigned short, unsigned int, unsigned long);
|
||||
|
||||
void pass_short(short);
|
||||
|
||||
// --- import_ints.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "ints.h";
|
||||
|
||||
fn MyF() {
|
||||
Cpp.pass_signed(1, 2, 3, 4);
|
||||
|
||||
Cpp.pass_unsigned(1, 2, 3, 4);
|
||||
}
|
||||
|
||||
fn MakeShort() -> i16;
|
||||
|
||||
var c: i16;
|
||||
|
||||
fn PassShort(a: i16, b: i16*) {
|
||||
Cpp.pass_short(a);
|
||||
Cpp.pass_short(*b);
|
||||
Cpp.pass_short(c);
|
||||
Cpp.pass_short(MakeShort());
|
||||
}
|
||||
|
||||
// --- struct.h
|
||||
|
||||
struct X {
|
||||
int a;
|
||||
int b;
|
||||
int c;
|
||||
};
|
||||
|
||||
void pass_struct(X);
|
||||
|
||||
// --- import_struct.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "struct.h";
|
||||
|
||||
fn Test() {
|
||||
var x: Cpp.X;
|
||||
x.a = 1;
|
||||
x.b = 2;
|
||||
x.c = 3;
|
||||
Cpp.pass_struct(x);
|
||||
}
|
||||
|
||||
// --- class_with_nontrivial_copy.h
|
||||
|
||||
class Y {
|
||||
public:
|
||||
Y(const Y&);
|
||||
|
||||
int a;
|
||||
int b;
|
||||
int c;
|
||||
};
|
||||
|
||||
void pass_struct(Y);
|
||||
|
||||
// --- import_class_with_nontrivial_copy.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "class_with_nontrivial_copy.h";
|
||||
|
||||
fn PassRefExpr() {
|
||||
var y: Cpp.Y;
|
||||
y.a = 1;
|
||||
y.b = 2;
|
||||
y.c = 3;
|
||||
Cpp.pass_struct(y);
|
||||
}
|
||||
|
||||
fn Make() -> Cpp.Y;
|
||||
|
||||
fn PassInitExpr() {
|
||||
Cpp.pass_struct(Make());
|
||||
}
|
||||
|
||||
fn PassValueExpr(y: Cpp.Y) {
|
||||
Cpp.pass_struct(y);
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_ints.carbon'
|
||||
// CHECK:STDOUT: source_filename = "import_ints.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: @int_1.f1e = internal constant i8 1
|
||||
// CHECK:STDOUT: @int_2.5c2 = internal constant i16 2
|
||||
// CHECK:STDOUT: @int_1.067 = internal constant i8 1
|
||||
// CHECK:STDOUT: @int_2.ec3 = internal constant i16 2
|
||||
// CHECK:STDOUT: @_Cc.Main = global i16 0
|
||||
// CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7_19.3.temp = alloca i8, align 1, !dbg !14
|
||||
// CHECK:STDOUT: %.loc7_22.3.temp = alloca i16, align 2, !dbg !15
|
||||
// CHECK:STDOUT: %.loc9_21.3.temp = alloca i8, align 1, !dbg !16
|
||||
// CHECK:STDOUT: %.loc9_24.3.temp = alloca i16, align 2, !dbg !17
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_19.3.temp), !dbg !14
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_22.3.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z11pass_signedasil.carbon_thunk.____(ptr @int_1.f1e, ptr @int_2.5c2, i32 3, i64 4), !dbg !18
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_21.3.temp), !dbg !16
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_24.3.temp), !dbg !17
|
||||
// CHECK:STDOUT: call void @_Z13pass_unsignedhtjm.carbon_thunk.____(ptr @int_1.067, ptr @int_2.ec3, i32 3, i64 4), !dbg !19
|
||||
// CHECK:STDOUT: call void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr @int_2.ec3), !dbg !17
|
||||
// CHECK:STDOUT: call void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr @int_1.067), !dbg !16
|
||||
// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr @int_2.5c2), !dbg !15
|
||||
// CHECK:STDOUT: call void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr @int_1.f1e), !dbg !14
|
||||
// CHECK:STDOUT: ret void, !dbg !20
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z11pass_signedasil.carbon_thunk.____(ptr noundef %0, ptr noundef %1, i32 noundef %2, i64 noundef %3) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %.addr1 = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %.addr2 = alloca i32, align 4
|
||||
// CHECK:STDOUT: %.addr3 = alloca i64, align 8
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !24
|
||||
// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !7
|
||||
// CHECK:STDOUT: store i64 %3, ptr %.addr3, align 8, !tbaa !26
|
||||
// CHECK:STDOUT: %4 = load ptr, ptr %.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: %5 = load i8, ptr %4, align 1, !tbaa !28
|
||||
// CHECK:STDOUT: %6 = load ptr, ptr %.addr1, align 8, !tbaa !24
|
||||
// CHECK:STDOUT: %7 = load i16, ptr %6, align 2, !tbaa !29
|
||||
// CHECK:STDOUT: %8 = load i32, ptr %.addr2, align 4, !tbaa !7
|
||||
// CHECK:STDOUT: %9 = load i64, ptr %.addr3, align 8, !tbaa !26
|
||||
// CHECK:STDOUT: call void @_Z11pass_signedasil(i8 noundef signext %5, i16 noundef signext %7, i32 noundef %8, i64 noundef %9)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z13pass_unsignedhtjm.carbon_thunk.____(ptr noundef %0, ptr noundef %1, i32 noundef %2, i64 noundef %3) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %.addr1 = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %.addr2 = alloca i32, align 4
|
||||
// CHECK:STDOUT: %.addr3 = alloca i64, align 8
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !24
|
||||
// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !7
|
||||
// CHECK:STDOUT: store i64 %3, ptr %.addr3, align 8, !tbaa !26
|
||||
// CHECK:STDOUT: %4 = load ptr, ptr %.addr, align 8, !tbaa !21
|
||||
// CHECK:STDOUT: %5 = load i8, ptr %4, align 1, !tbaa !28
|
||||
// CHECK:STDOUT: %6 = load ptr, ptr %.addr1, align 8, !tbaa !24
|
||||
// CHECK:STDOUT: %7 = load i16, ptr %6, align 2, !tbaa !29
|
||||
// CHECK:STDOUT: %8 = load i32, ptr %.addr2, align 4, !tbaa !7
|
||||
// CHECK:STDOUT: %9 = load i64, ptr %.addr3, align 8, !tbaa !26
|
||||
// CHECK:STDOUT: call void @_Z13pass_unsignedhtjm(i8 noundef zeroext %5, i16 noundef zeroext %7, i32 noundef %8, i64 noundef %9)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr %self) #0 !dbg !31 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !37
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr %self) #0 !dbg !38 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !44
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %self) #0 !dbg !45 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !51
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %self) #0 !dbg !52 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !58
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare i16 @_CMakeShort.Main()
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassShort.Main(i16 %a, ptr %b) #0 !dbg !59 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc17_18.1.temp = alloca i16, align 2, !dbg !66
|
||||
// CHECK:STDOUT: %.loc18_18.3.temp = alloca i16, align 2, !dbg !67
|
||||
// CHECK:STDOUT: %.loc19_18.2.temp = alloca i16, align 2, !dbg !68
|
||||
// CHECK:STDOUT: %.loc20_28.3.temp = alloca i16, align 2, !dbg !69
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_18.1.temp), !dbg !66
|
||||
// CHECK:STDOUT: store i16 %a, ptr %.loc17_18.1.temp, align 2, !dbg !66
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc17_18.1.temp), !dbg !70
|
||||
// CHECK:STDOUT: %.loc18_18.2 = load i16, ptr %b, align 2, !dbg !67
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_18.3.temp), !dbg !67
|
||||
// CHECK:STDOUT: store i16 %.loc18_18.2, ptr %.loc18_18.3.temp, align 2, !dbg !67
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc18_18.3.temp), !dbg !71
|
||||
// CHECK:STDOUT: %.loc19_18.1 = load i16, ptr @_Cc.Main, align 2, !dbg !68
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_18.2.temp), !dbg !68
|
||||
// CHECK:STDOUT: store i16 %.loc19_18.1, ptr %.loc19_18.2.temp, align 2, !dbg !68
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc19_18.2.temp), !dbg !72
|
||||
// CHECK:STDOUT: %MakeShort.call = call i16 @_CMakeShort.Main(), !dbg !69
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_28.3.temp), !dbg !69
|
||||
// CHECK:STDOUT: store i16 %MakeShort.call, ptr %.loc20_28.3.temp, align 2, !dbg !69
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc20_28.3.temp), !dbg !73
|
||||
// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc20_28.3.temp), !dbg !69
|
||||
// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc19_18.2.temp), !dbg !68
|
||||
// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc18_18.3.temp), !dbg !67
|
||||
// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc17_18.1.temp), !dbg !66
|
||||
// CHECK:STDOUT: ret void, !dbg !74
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z10pass_shorts.carbon_thunk._(ptr noundef %0) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !24
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !24
|
||||
// CHECK:STDOUT: %2 = load i16, ptr %1, align 2, !tbaa !29
|
||||
// CHECK:STDOUT: call void @_Z10pass_shorts(i16 noundef signext %2)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define internal void @_C__global_init.Main() #0 !dbg !75 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: store i16 poison, ptr @_Cc.Main, align 2, !dbg !76
|
||||
// CHECK:STDOUT: ret void, !dbg !77
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z11pass_signedasil(i8 noundef signext, i16 noundef signext, i32 noundef, i64 noundef) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z13pass_unsignedhtjm(i8 noundef zeroext, i16 noundef zeroext, i32 noundef, i64 noundef) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z10pass_shorts(i16 noundef signext) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @_Z10pass_shorts.carbon_thunk._, { 3, 2, 1, 0 }
|
||||
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 7, 6, 5, 4, 3, 2, 1, 0 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
||||
// CHECK:STDOUT: attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_ints.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !6, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !12 = !DISubroutineType(types: !13)
|
||||
// CHECK:STDOUT: !13 = !{null}
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 19, scope: !11)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 22, scope: !11)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 9, column: 21, scope: !11)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 9, column: 24, scope: !11)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 9, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 6, column: 1, scope: !11)
|
||||
// CHECK:STDOUT: !21 = !{!22, !22, i64 0}
|
||||
// CHECK:STDOUT: !22 = !{!"p1 omnipotent char", !23, i64 0}
|
||||
// CHECK:STDOUT: !23 = !{!"any pointer", !9, i64 0}
|
||||
// CHECK:STDOUT: !24 = !{!25, !25, i64 0}
|
||||
// CHECK:STDOUT: !25 = !{!"p1 short", !23, i64 0}
|
||||
// CHECK:STDOUT: !26 = !{!27, !27, i64 0}
|
||||
// CHECK:STDOUT: !27 = !{!"long", !9, i64 0}
|
||||
// CHECK:STDOUT: !28 = !{!9, !9, i64 0}
|
||||
// CHECK:STDOUT: !29 = !{!30, !30, i64 0}
|
||||
// CHECK:STDOUT: !30 = !{!"short", !9, i64 0}
|
||||
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6fd0ed7da7a22bb4:core.Destroy.Core", scope: null, file: !6, line: 9, type: !32, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !35)
|
||||
// CHECK:STDOUT: !32 = !DISubroutineType(types: !33)
|
||||
// CHECK:STDOUT: !33 = !{null, !34}
|
||||
// CHECK:STDOUT: !34 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_unsigned)
|
||||
// CHECK:STDOUT: !35 = !{!36}
|
||||
// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !31, type: !34)
|
||||
// CHECK:STDOUT: !37 = !DILocation(line: 9, column: 24, scope: !31)
|
||||
// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core", scope: null, file: !6, line: 9, type: !39, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !42)
|
||||
// CHECK:STDOUT: !39 = !DISubroutineType(types: !40)
|
||||
// CHECK:STDOUT: !40 = !{null, !41}
|
||||
// CHECK:STDOUT: !41 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_unsigned)
|
||||
// CHECK:STDOUT: !42 = !{!43}
|
||||
// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !38, type: !41)
|
||||
// CHECK:STDOUT: !44 = !DILocation(line: 9, column: 21, scope: !38)
|
||||
// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.eb6702152d47e49f:core.Destroy.Core", scope: null, file: !6, line: 7, type: !46, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !49)
|
||||
// CHECK:STDOUT: !46 = !DISubroutineType(types: !47)
|
||||
// CHECK:STDOUT: !47 = !{null, !48}
|
||||
// CHECK:STDOUT: !48 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !49 = !{!50}
|
||||
// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !45, type: !48)
|
||||
// CHECK:STDOUT: !51 = !DILocation(line: 7, column: 22, scope: !45)
|
||||
// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Op", linkageName: "_COp.578b3934f85dbca6:core.Destroy.Core", scope: null, file: !6, line: 7, type: !53, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !56)
|
||||
// CHECK:STDOUT: !53 = !DISubroutineType(types: !54)
|
||||
// CHECK:STDOUT: !54 = !{null, !55}
|
||||
// CHECK:STDOUT: !55 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !56 = !{!57}
|
||||
// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !52, type: !55)
|
||||
// CHECK:STDOUT: !58 = !DILocation(line: 7, column: 19, scope: !52)
|
||||
// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "PassShort", linkageName: "_CPassShort.Main", scope: null, file: !6, line: 16, type: !60, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !63)
|
||||
// CHECK:STDOUT: !60 = !DISubroutineType(types: !61)
|
||||
// CHECK:STDOUT: !61 = !{null, !48, !62}
|
||||
// CHECK:STDOUT: !62 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
// CHECK:STDOUT: !63 = !{!64, !65}
|
||||
// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !59, type: !48)
|
||||
// CHECK:STDOUT: !65 = !DILocalVariable(arg: 2, scope: !59, type: !62)
|
||||
// CHECK:STDOUT: !66 = !DILocation(line: 17, column: 18, scope: !59)
|
||||
// CHECK:STDOUT: !67 = !DILocation(line: 18, column: 18, scope: !59)
|
||||
// CHECK:STDOUT: !68 = !DILocation(line: 19, column: 18, scope: !59)
|
||||
// CHECK:STDOUT: !69 = !DILocation(line: 20, column: 18, scope: !59)
|
||||
// CHECK:STDOUT: !70 = !DILocation(line: 17, column: 3, scope: !59)
|
||||
// CHECK:STDOUT: !71 = !DILocation(line: 18, column: 3, scope: !59)
|
||||
// CHECK:STDOUT: !72 = !DILocation(line: 19, column: 3, scope: !59)
|
||||
// CHECK:STDOUT: !73 = !DILocation(line: 20, column: 3, scope: !59)
|
||||
// CHECK:STDOUT: !74 = !DILocation(line: 16, column: 1, scope: !59)
|
||||
// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !6, type: !12, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !76 = !DILocation(line: 14, column: 1, scope: !75)
|
||||
// CHECK:STDOUT: !77 = !DILocation(line: 0, scope: !75)
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_struct.carbon'
|
||||
// CHECK:STDOUT: source_filename = "import_struct.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %struct.X = type { i32, i32, i32 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CTest.Main() #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %x.var = alloca [12 x i8], align 4, !dbg !14
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !14
|
||||
// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1"(ptr %x.var), !dbg !14
|
||||
// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 0, !dbg !15
|
||||
// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !15
|
||||
// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 4, !dbg !16
|
||||
// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !16
|
||||
// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 8, !dbg !17
|
||||
// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !17
|
||||
// CHECK:STDOUT: call void @_Z11pass_struct1X.carbon_thunk._(ptr %x.var), !dbg !18
|
||||
// CHECK:STDOUT: ret void, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
|
||||
// CHECK:STDOUT: define internal void @_ZN1XC1Ev.carbon_thunk.(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !20
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !20
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
|
||||
// CHECK:STDOUT: define void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr sret([12 x i8]) %return) #2 !dbg !23 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_ZN1XC1Ev.carbon_thunk.(ptr %return), !dbg !28
|
||||
// CHECK:STDOUT: ret void, !dbg !28
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z11pass_struct1X.carbon_thunk._(ptr noundef %0) #3 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %struct.X, align 4
|
||||
// CHECK:STDOUT: %agg.tmp.coerce = alloca { i64, i32 }, align 4
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !20
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !20
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 12, i1 false), !tbaa.struct !29
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp.coerce, ptr align 4 %agg.tmp, i64 12, i1 false)
|
||||
// CHECK:STDOUT: %2 = getelementptr inbounds nuw { i64, i32 }, ptr %agg.tmp.coerce, i32 0, i32 0
|
||||
// CHECK:STDOUT: %3 = load i64, ptr %2, align 4
|
||||
// CHECK:STDOUT: %4 = getelementptr inbounds nuw { i64, i32 }, ptr %agg.tmp.coerce, i32 0, i32 1
|
||||
// CHECK:STDOUT: %5 = load i32, ptr %4, align 4
|
||||
// CHECK:STDOUT: call void @_Z11pass_struct1X(i64 %3, i32 %5)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #4
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1"(ptr sret([12 x i8]) %return) #0 !dbg !30 {
|
||||
// CHECK:STDOUT: call void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr %return), !dbg !32
|
||||
// CHECK:STDOUT: ret void, !dbg !33
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z11pass_struct1X(i64, i32) #5
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #4
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 1, 0 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #2 = { alwaysinline nounwind }
|
||||
// CHECK:STDOUT: attributes #3 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
||||
// CHECK:STDOUT: attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_struct.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !6, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !12 = !DISubroutineType(types: !13)
|
||||
// CHECK:STDOUT: !13 = !{null}
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 8, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 9, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 10, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 11, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 6, column: 1, scope: !11)
|
||||
// CHECK:STDOUT: !20 = !{!21, !21, i64 0}
|
||||
// CHECK:STDOUT: !21 = !{!"p1 _ZTS1X", !22, i64 0}
|
||||
// CHECK:STDOUT: !22 = !{!"any pointer", !9, i64 0}
|
||||
// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp", scope: null, file: !24, line: 2, type: !25, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !24 = !DIFile(filename: "./struct.h", directory: "")
|
||||
// CHECK:STDOUT: !25 = !DISubroutineType(types: !26)
|
||||
// CHECK:STDOUT: !26 = !{!27}
|
||||
// CHECK:STDOUT: !27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
// CHECK:STDOUT: !28 = !DILocation(line: 2, column: 8, scope: !23)
|
||||
// CHECK:STDOUT: !29 = !{i64 0, i64 4, !7, i64 4, i64 4, !7, i64 8, i64 4, !7}
|
||||
// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1", scope: null, file: !31, line: 9, type: !25, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !31 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "")
|
||||
// CHECK:STDOUT: !32 = !DILocation(line: 9, column: 28, scope: !30)
|
||||
// CHECK:STDOUT: !33 = !DILocation(line: 9, column: 21, scope: !30)
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_class_with_nontrivial_copy.carbon'
|
||||
// CHECK:STDOUT: source_filename = "import_class_with_nontrivial_copy.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %class.Y = type { i32, i32, i32 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassRefExpr.Main() #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %y.var = alloca [12 x i8], align 4, !dbg !14
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %y.var), !dbg !14
|
||||
// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 0, !dbg !15
|
||||
// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !15
|
||||
// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 4, !dbg !16
|
||||
// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !16
|
||||
// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 8, !dbg !17
|
||||
// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !17
|
||||
// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y.var), !dbg !18
|
||||
// CHECK:STDOUT: ret void, !dbg !19
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z11pass_struct1Y.carbon_thunk._(ptr noundef %0) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.Y, align 4
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !20
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !20
|
||||
// CHECK:STDOUT: call void @_ZN1YC1ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %agg.tmp, ptr noundef nonnull align 4 dereferenceable(12) %1)
|
||||
// CHECK:STDOUT: call void @_Z11pass_struct1Y(ptr noundef dead_on_return %agg.tmp)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_CMake.Main(ptr sret([12 x i8]))
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassInitExpr.Main() #0 !dbg !23 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc17_24.1.temp = alloca [12 x i8], align 4, !dbg !24
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_24.1.temp), !dbg !24
|
||||
// CHECK:STDOUT: call void @_CMake.Main(ptr %.loc17_24.1.temp), !dbg !24
|
||||
// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %.loc17_24.1.temp), !dbg !25
|
||||
// CHECK:STDOUT: ret void, !dbg !26
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CPassValueExpr.Main(ptr %y) #0 !dbg !27 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y), !dbg !33
|
||||
// CHECK:STDOUT: ret void, !dbg !34
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z11pass_struct1Y(ptr noundef dead_on_return) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_ZN1YC1ERKS_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
||||
// CHECK:STDOUT: attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_class_with_nontrivial_copy.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "PassRefExpr", linkageName: "_CPassRefExpr.Main", scope: null, file: !6, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !12 = !DISubroutineType(types: !13)
|
||||
// CHECK:STDOUT: !13 = !{null}
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 8, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 9, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 10, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 11, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 6, column: 1, scope: !11)
|
||||
// CHECK:STDOUT: !20 = !{!21, !21, i64 0}
|
||||
// CHECK:STDOUT: !21 = !{!"p1 _ZTS1Y", !22, i64 0}
|
||||
// CHECK:STDOUT: !22 = !{!"any pointer", !9, i64 0}
|
||||
// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "PassInitExpr", linkageName: "_CPassInitExpr.Main", scope: null, file: !6, line: 16, type: !12, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 17, column: 19, scope: !23)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 17, column: 3, scope: !23)
|
||||
// CHECK:STDOUT: !26 = !DILocation(line: 16, column: 1, scope: !23)
|
||||
// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "PassValueExpr", linkageName: "_CPassValueExpr.Main", scope: null, file: !6, line: 20, type: !28, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !31)
|
||||
// CHECK:STDOUT: !28 = !DISubroutineType(types: !29)
|
||||
// CHECK:STDOUT: !29 = !{null, !30}
|
||||
// CHECK:STDOUT: !30 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
// CHECK:STDOUT: !31 = !{!32}
|
||||
// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !27, type: !30)
|
||||
// CHECK:STDOUT: !33 = !DILocation(line: 21, column: 3, scope: !27)
|
||||
// CHECK:STDOUT: !34 = !DILocation(line: 20, column: 1, scope: !27)
|
||||
@@ -0,0 +1,707 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon
|
||||
// EXTRA-ARGS: --target=x86_64-linux-gnu
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/function/import/return.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/function/import/return.carbon
|
||||
|
||||
// --- ints.h
|
||||
|
||||
unsigned char ReturnU8();
|
||||
unsigned short ReturnU16();
|
||||
unsigned int ReturnU32();
|
||||
unsigned long ReturnU64();
|
||||
|
||||
signed char ReturnI8();
|
||||
signed short ReturnI16();
|
||||
signed int ReturnI32();
|
||||
signed long ReturnI64();
|
||||
|
||||
// --- import_ints.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "ints.h";
|
||||
|
||||
fn GetU8() -> u8 { return Cpp.ReturnU8(); }
|
||||
fn GetU16() -> u16 { return Cpp.ReturnU16(); }
|
||||
fn GetU32() -> u32 { return Cpp.ReturnU32(); }
|
||||
fn GetU64() -> u64 { return Cpp.ReturnU64(); }
|
||||
|
||||
fn GetI8() -> i8 { return Cpp.ReturnI8(); }
|
||||
fn GetI16() -> i16 { return Cpp.ReturnI16(); }
|
||||
fn GetI32() -> i32 { return Cpp.ReturnI32(); }
|
||||
fn GetI64() -> i64 { return Cpp.ReturnI64(); }
|
||||
|
||||
fn Use(a: u8, b: u16, c: u32, d: u64, e: i8, f: i16, g: i32, h: i64);
|
||||
|
||||
fn Lets() {
|
||||
let my_u8: u8 = Cpp.ReturnU8();
|
||||
let my_u16: u16 = Cpp.ReturnU16();
|
||||
let my_u32: u32 = Cpp.ReturnU32();
|
||||
let my_u64: u64 = Cpp.ReturnU64();
|
||||
|
||||
let my_i8: i8 = Cpp.ReturnI8();
|
||||
let my_i16: i16 = Cpp.ReturnI16();
|
||||
let my_i32: i32 = Cpp.ReturnI32();
|
||||
let my_i64: i64 = Cpp.ReturnI64();
|
||||
|
||||
Use(my_u8, my_u16, my_u32, my_u64, my_i8, my_i16, my_i32, my_i64);
|
||||
}
|
||||
|
||||
fn Vars() {
|
||||
var my_u8: u8 = Cpp.ReturnU8();
|
||||
var my_u16: u16 = Cpp.ReturnU16();
|
||||
var my_u32: u32 = Cpp.ReturnU32();
|
||||
var my_u64: u64 = Cpp.ReturnU64();
|
||||
|
||||
var my_i8: i8 = Cpp.ReturnI8();
|
||||
var my_i16: i16 = Cpp.ReturnI16();
|
||||
var my_i32: i32 = Cpp.ReturnI32();
|
||||
var my_i64: i64 = Cpp.ReturnI64();
|
||||
|
||||
Use(my_u8, my_u16, my_u32, my_u64, my_i8, my_i16, my_i32, my_i64);
|
||||
}
|
||||
|
||||
// --- class.h
|
||||
|
||||
struct X {
|
||||
X();
|
||||
X(const X&);
|
||||
~X();
|
||||
|
||||
void* _Nonnull p;
|
||||
void* _Nonnull q;
|
||||
};
|
||||
|
||||
X Make();
|
||||
|
||||
// --- import_class.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "class.h";
|
||||
|
||||
fn GetX() -> Cpp.X { return Cpp.Make(); }
|
||||
|
||||
fn Let() {
|
||||
let _: Cpp.X = Cpp.Make();
|
||||
}
|
||||
|
||||
fn Var() {
|
||||
var _: Cpp.X = Cpp.Make();
|
||||
}
|
||||
|
||||
// --- indirect_return_with_args.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
class C {};
|
||||
class D {};
|
||||
C f(D);
|
||||
''';
|
||||
|
||||
fn Call(x: Cpp.D) -> Cpp.C {
|
||||
return Cpp.f(x);
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_ints.carbon'
|
||||
// CHECK:STDOUT: source_filename = "import_ints.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i8 @_CGetU8.Main() #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc6_40.1.temp = alloca i8, align 1, !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc6_40.1.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk.(ptr %.loc6_40.1.temp), !dbg !15
|
||||
// CHECK:STDOUT: %0 = load i8, ptr %.loc6_40.1.temp, align 1, !dbg !16
|
||||
// CHECK:STDOUT: ret i8 %0, !dbg !16
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z8ReturnU8v.carbon_thunk.(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !17
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i8 @_Z8ReturnU8v()
|
||||
// CHECK:STDOUT: store i8 %call, ptr %0, align 1, !tbaa !20
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i16 @_CGetU16.Main() #0 !dbg !21 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc7_43.1.temp = alloca i16, align 2, !dbg !25
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_43.1.temp), !dbg !25
|
||||
// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk.(ptr %.loc7_43.1.temp), !dbg !25
|
||||
// CHECK:STDOUT: %0 = load i16, ptr %.loc7_43.1.temp, align 2, !dbg !26
|
||||
// CHECK:STDOUT: ret i16 %0, !dbg !26
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z9ReturnU16v.carbon_thunk.(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !27
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !27
|
||||
// CHECK:STDOUT: %call = call noundef zeroext i16 @_Z9ReturnU16v()
|
||||
// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !29
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CGetU32.Main() #0 !dbg !31 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !35
|
||||
// CHECK:STDOUT: ret i32 %ReturnU32.call, !dbg !36
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare noundef i32 @_Z9ReturnU32v() #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i64 @_CGetU64.Main() #0 !dbg !37 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !41
|
||||
// CHECK:STDOUT: ret i64 %ReturnU64.call, !dbg !42
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare noundef i64 @_Z9ReturnU64v() #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i8 @_CGetI8.Main() #0 !dbg !43 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc11_40.1.temp = alloca i8, align 1, !dbg !47
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_40.1.temp), !dbg !47
|
||||
// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk.(ptr %.loc11_40.1.temp), !dbg !47
|
||||
// CHECK:STDOUT: %0 = load i8, ptr %.loc11_40.1.temp, align 1, !dbg !48
|
||||
// CHECK:STDOUT: ret i8 %0, !dbg !48
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z8ReturnI8v.carbon_thunk.(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !17
|
||||
// CHECK:STDOUT: %call = call noundef signext i8 @_Z8ReturnI8v()
|
||||
// CHECK:STDOUT: store i8 %call, ptr %0, align 1, !tbaa !20
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i16 @_CGetI16.Main() #0 !dbg !49 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc12_43.1.temp = alloca i16, align 2, !dbg !53
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_43.1.temp), !dbg !53
|
||||
// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk.(ptr %.loc12_43.1.temp), !dbg !53
|
||||
// CHECK:STDOUT: %0 = load i16, ptr %.loc12_43.1.temp, align 2, !dbg !54
|
||||
// CHECK:STDOUT: ret i16 %0, !dbg !54
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z9ReturnI16v.carbon_thunk.(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !27
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !27
|
||||
// CHECK:STDOUT: %call = call noundef signext i16 @_Z9ReturnI16v()
|
||||
// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !29
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i32 @_CGetI32.Main() #0 !dbg !55 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !59
|
||||
// CHECK:STDOUT: ret i32 %ReturnI32.call, !dbg !60
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare noundef i32 @_Z9ReturnI32v() #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define i64 @_CGetI64.Main() #0 !dbg !61 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !65
|
||||
// CHECK:STDOUT: ret i64 %ReturnI64.call, !dbg !66
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare noundef i64 @_Z9ReturnI64v() #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_CUse.Main(i8, i16, i32, i64, i8, i16, i32, i64)
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CLets.Main() #0 !dbg !67 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc19_32.1.temp = alloca i8, align 1, !dbg !70
|
||||
// CHECK:STDOUT: %.loc20_35.1.temp = alloca i16, align 2, !dbg !71
|
||||
// CHECK:STDOUT: %.loc24_32.1.temp = alloca i8, align 1, !dbg !72
|
||||
// CHECK:STDOUT: %.loc25_35.1.temp = alloca i16, align 2, !dbg !73
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_32.1.temp), !dbg !70
|
||||
// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk.(ptr %.loc19_32.1.temp), !dbg !70
|
||||
// CHECK:STDOUT: %.loc19_32.4 = load i8, ptr %.loc19_32.1.temp, align 1, !dbg !70
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_35.1.temp), !dbg !71
|
||||
// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk.(ptr %.loc20_35.1.temp), !dbg !71
|
||||
// CHECK:STDOUT: %.loc20_35.4 = load i16, ptr %.loc20_35.1.temp, align 2, !dbg !71
|
||||
// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !74
|
||||
// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !75
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_32.1.temp), !dbg !72
|
||||
// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk.(ptr %.loc24_32.1.temp), !dbg !72
|
||||
// CHECK:STDOUT: %.loc24_32.4 = load i8, ptr %.loc24_32.1.temp, align 1, !dbg !72
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_35.1.temp), !dbg !73
|
||||
// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk.(ptr %.loc25_35.1.temp), !dbg !73
|
||||
// CHECK:STDOUT: %.loc25_35.4 = load i16, ptr %.loc25_35.1.temp, align 2, !dbg !73
|
||||
// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !76
|
||||
// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !77
|
||||
// CHECK:STDOUT: call void @_CUse.Main(i8 %.loc19_32.4, i16 %.loc20_35.4, i32 %ReturnU32.call, i64 %ReturnU64.call, i8 %.loc24_32.4, i16 %.loc25_35.4, i32 %ReturnI32.call, i64 %ReturnI64.call), !dbg !78
|
||||
// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc25_35.1.temp), !dbg !73
|
||||
// CHECK:STDOUT: call void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %.loc24_32.1.temp), !dbg !72
|
||||
// CHECK:STDOUT: call void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr %.loc20_35.1.temp), !dbg !71
|
||||
// CHECK:STDOUT: call void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr %.loc19_32.1.temp), !dbg !70
|
||||
// CHECK:STDOUT: ret void, !dbg !79
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %self) #0 !dbg !80 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !85
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %self) #0 !dbg !86 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !91
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr %self) #0 !dbg !92 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !97
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr %self) #0 !dbg !98 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !103
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CVars.Main() #0 !dbg !104 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %my_u8.var = alloca i8, align 1, !dbg !105
|
||||
// CHECK:STDOUT: %my_u16.var = alloca i16, align 2, !dbg !106
|
||||
// CHECK:STDOUT: %my_u32.var = alloca i32, align 4, !dbg !107
|
||||
// CHECK:STDOUT: %my_u64.var = alloca i64, align 8, !dbg !108
|
||||
// CHECK:STDOUT: %my_i8.var = alloca i8, align 1, !dbg !109
|
||||
// CHECK:STDOUT: %my_i16.var = alloca i16, align 2, !dbg !110
|
||||
// CHECK:STDOUT: %my_i32.var = alloca i32, align 4, !dbg !111
|
||||
// CHECK:STDOUT: %my_i64.var = alloca i64, align 8, !dbg !112
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u8.var), !dbg !105
|
||||
// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk.(ptr %my_u8.var), !dbg !113
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u16.var), !dbg !106
|
||||
// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk.(ptr %my_u16.var), !dbg !114
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u32.var), !dbg !107
|
||||
// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !115
|
||||
// CHECK:STDOUT: store i32 %ReturnU32.call, ptr %my_u32.var, align 4, !dbg !107
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u64.var), !dbg !108
|
||||
// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !116
|
||||
// CHECK:STDOUT: store i64 %ReturnU64.call, ptr %my_u64.var, align 8, !dbg !108
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i8.var), !dbg !109
|
||||
// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk.(ptr %my_i8.var), !dbg !117
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i16.var), !dbg !110
|
||||
// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk.(ptr %my_i16.var), !dbg !118
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i32.var), !dbg !111
|
||||
// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !119
|
||||
// CHECK:STDOUT: store i32 %ReturnI32.call, ptr %my_i32.var, align 4, !dbg !111
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i64.var), !dbg !112
|
||||
// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !120
|
||||
// CHECK:STDOUT: store i64 %ReturnI64.call, ptr %my_i64.var, align 8, !dbg !112
|
||||
// CHECK:STDOUT: %.loc43_7 = load i8, ptr %my_u8.var, align 1, !dbg !121
|
||||
// CHECK:STDOUT: %.loc43_14 = load i16, ptr %my_u16.var, align 2, !dbg !122
|
||||
// CHECK:STDOUT: %.loc43_22 = load i32, ptr %my_u32.var, align 4, !dbg !123
|
||||
// CHECK:STDOUT: %.loc43_30 = load i64, ptr %my_u64.var, align 8, !dbg !124
|
||||
// CHECK:STDOUT: %.loc43_38 = load i8, ptr %my_i8.var, align 1, !dbg !125
|
||||
// CHECK:STDOUT: %.loc43_45 = load i16, ptr %my_i16.var, align 2, !dbg !126
|
||||
// CHECK:STDOUT: %.loc43_53 = load i32, ptr %my_i32.var, align 4, !dbg !127
|
||||
// CHECK:STDOUT: %.loc43_61 = load i64, ptr %my_i64.var, align 8, !dbg !128
|
||||
// CHECK:STDOUT: call void @_CUse.Main(i8 %.loc43_7, i16 %.loc43_14, i32 %.loc43_22, i64 %.loc43_30, i8 %.loc43_38, i16 %.loc43_45, i32 %.loc43_53, i64 %.loc43_61), !dbg !129
|
||||
// CHECK:STDOUT: call void @"_COp.fbec46972c1998a0:core.Destroy.Core"(ptr %my_i64.var), !dbg !112
|
||||
// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %my_i32.var), !dbg !111
|
||||
// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %my_i16.var), !dbg !110
|
||||
// CHECK:STDOUT: call void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %my_i8.var), !dbg !109
|
||||
// CHECK:STDOUT: call void @"_COp.df57f49075d1fe6b:core.Destroy.Core"(ptr %my_u64.var), !dbg !108
|
||||
// CHECK:STDOUT: call void @"_COp.45ecfb19e8cc5ab3:core.Destroy.Core"(ptr %my_u32.var), !dbg !107
|
||||
// CHECK:STDOUT: call void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr %my_u16.var), !dbg !106
|
||||
// CHECK:STDOUT: call void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr %my_u8.var), !dbg !105
|
||||
// CHECK:STDOUT: ret void, !dbg !130
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.fbec46972c1998a0:core.Destroy.Core"(ptr %self) #0 !dbg !131 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !136
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !137 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !142
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.df57f49075d1fe6b:core.Destroy.Core"(ptr %self) #0 !dbg !143 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !148
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define weak_odr void @"_COp.45ecfb19e8cc5ab3:core.Destroy.Core"(ptr %self) #0 !dbg !149 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: ret void, !dbg !154
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare noundef zeroext i8 @_Z8ReturnU8v() #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare noundef zeroext i16 @_Z9ReturnU16v() #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare noundef signext i8 @_Z8ReturnI8v() #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare noundef signext i16 @_Z9ReturnI16v() #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_ints.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "GetU8", linkageName: "_CGetU8.Main", scope: null, file: !6, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !12 = !DISubroutineType(types: !13)
|
||||
// CHECK:STDOUT: !13 = !{!14}
|
||||
// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_unsigned)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 27, scope: !11)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 20, scope: !11)
|
||||
// CHECK:STDOUT: !17 = !{!18, !18, i64 0}
|
||||
// CHECK:STDOUT: !18 = !{!"p1 omnipotent char", !19, i64 0}
|
||||
// CHECK:STDOUT: !19 = !{!"any pointer", !9, i64 0}
|
||||
// CHECK:STDOUT: !20 = !{!9, !9, i64 0}
|
||||
// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "GetU16", linkageName: "_CGetU16.Main", scope: null, file: !6, line: 7, type: !22, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !22 = !DISubroutineType(types: !23)
|
||||
// CHECK:STDOUT: !23 = !{!24}
|
||||
// CHECK:STDOUT: !24 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_unsigned)
|
||||
// CHECK:STDOUT: !25 = !DILocation(line: 7, column: 29, scope: !21)
|
||||
// CHECK:STDOUT: !26 = !DILocation(line: 7, column: 22, scope: !21)
|
||||
// CHECK:STDOUT: !27 = !{!28, !28, i64 0}
|
||||
// CHECK:STDOUT: !28 = !{!"p1 short", !19, i64 0}
|
||||
// CHECK:STDOUT: !29 = !{!30, !30, i64 0}
|
||||
// CHECK:STDOUT: !30 = !{!"short", !9, i64 0}
|
||||
// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "GetU32", linkageName: "_CGetU32.Main", scope: null, file: !6, line: 8, type: !32, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !32 = !DISubroutineType(types: !33)
|
||||
// CHECK:STDOUT: !33 = !{!34}
|
||||
// CHECK:STDOUT: !34 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_unsigned)
|
||||
// CHECK:STDOUT: !35 = !DILocation(line: 8, column: 29, scope: !31)
|
||||
// CHECK:STDOUT: !36 = !DILocation(line: 8, column: 22, scope: !31)
|
||||
// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "GetU64", linkageName: "_CGetU64.Main", scope: null, file: !6, line: 9, type: !38, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !38 = !DISubroutineType(types: !39)
|
||||
// CHECK:STDOUT: !39 = !{!40}
|
||||
// CHECK:STDOUT: !40 = !DIBasicType(name: "int", size: 64, encoding: DW_ATE_unsigned)
|
||||
// CHECK:STDOUT: !41 = !DILocation(line: 9, column: 29, scope: !37)
|
||||
// CHECK:STDOUT: !42 = !DILocation(line: 9, column: 22, scope: !37)
|
||||
// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "GetI8", linkageName: "_CGetI8.Main", scope: null, file: !6, line: 11, type: !44, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !44 = !DISubroutineType(types: !45)
|
||||
// CHECK:STDOUT: !45 = !{!46}
|
||||
// CHECK:STDOUT: !46 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !47 = !DILocation(line: 11, column: 27, scope: !43)
|
||||
// CHECK:STDOUT: !48 = !DILocation(line: 11, column: 20, scope: !43)
|
||||
// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "GetI16", linkageName: "_CGetI16.Main", scope: null, file: !6, line: 12, type: !50, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !50 = !DISubroutineType(types: !51)
|
||||
// CHECK:STDOUT: !51 = !{!52}
|
||||
// CHECK:STDOUT: !52 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !53 = !DILocation(line: 12, column: 29, scope: !49)
|
||||
// CHECK:STDOUT: !54 = !DILocation(line: 12, column: 22, scope: !49)
|
||||
// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "GetI32", linkageName: "_CGetI32.Main", scope: null, file: !6, line: 13, type: !56, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !56 = !DISubroutineType(types: !57)
|
||||
// CHECK:STDOUT: !57 = !{!58}
|
||||
// CHECK:STDOUT: !58 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !59 = !DILocation(line: 13, column: 29, scope: !55)
|
||||
// CHECK:STDOUT: !60 = !DILocation(line: 13, column: 22, scope: !55)
|
||||
// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "GetI64", linkageName: "_CGetI64.Main", scope: null, file: !6, line: 14, type: !62, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !62 = !DISubroutineType(types: !63)
|
||||
// CHECK:STDOUT: !63 = !{!64}
|
||||
// CHECK:STDOUT: !64 = !DIBasicType(name: "int", size: 64, encoding: DW_ATE_signed)
|
||||
// CHECK:STDOUT: !65 = !DILocation(line: 14, column: 29, scope: !61)
|
||||
// CHECK:STDOUT: !66 = !DILocation(line: 14, column: 22, scope: !61)
|
||||
// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "Lets", linkageName: "_CLets.Main", scope: null, file: !6, line: 18, type: !68, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !68 = !DISubroutineType(types: !69)
|
||||
// CHECK:STDOUT: !69 = !{null}
|
||||
// CHECK:STDOUT: !70 = !DILocation(line: 19, column: 19, scope: !67)
|
||||
// CHECK:STDOUT: !71 = !DILocation(line: 20, column: 21, scope: !67)
|
||||
// CHECK:STDOUT: !72 = !DILocation(line: 24, column: 19, scope: !67)
|
||||
// CHECK:STDOUT: !73 = !DILocation(line: 25, column: 21, scope: !67)
|
||||
// CHECK:STDOUT: !74 = !DILocation(line: 21, column: 21, scope: !67)
|
||||
// CHECK:STDOUT: !75 = !DILocation(line: 22, column: 21, scope: !67)
|
||||
// CHECK:STDOUT: !76 = !DILocation(line: 26, column: 21, scope: !67)
|
||||
// CHECK:STDOUT: !77 = !DILocation(line: 27, column: 21, scope: !67)
|
||||
// CHECK:STDOUT: !78 = !DILocation(line: 29, column: 3, scope: !67)
|
||||
// CHECK:STDOUT: !79 = !DILocation(line: 18, column: 1, scope: !67)
|
||||
// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "Op", linkageName: "_COp.eb6702152d47e49f:core.Destroy.Core", scope: null, file: !6, line: 25, type: !81, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !83)
|
||||
// CHECK:STDOUT: !81 = !DISubroutineType(types: !82)
|
||||
// CHECK:STDOUT: !82 = !{null, !52}
|
||||
// CHECK:STDOUT: !83 = !{!84}
|
||||
// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !80, type: !52)
|
||||
// CHECK:STDOUT: !85 = !DILocation(line: 25, column: 21, scope: !80)
|
||||
// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "Op", linkageName: "_COp.578b3934f85dbca6:core.Destroy.Core", scope: null, file: !6, line: 24, type: !87, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !89)
|
||||
// CHECK:STDOUT: !87 = !DISubroutineType(types: !88)
|
||||
// CHECK:STDOUT: !88 = !{null, !46}
|
||||
// CHECK:STDOUT: !89 = !{!90}
|
||||
// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !86, type: !46)
|
||||
// CHECK:STDOUT: !91 = !DILocation(line: 24, column: 19, scope: !86)
|
||||
// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6fd0ed7da7a22bb4:core.Destroy.Core", scope: null, file: !6, line: 20, type: !93, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !95)
|
||||
// CHECK:STDOUT: !93 = !DISubroutineType(types: !94)
|
||||
// CHECK:STDOUT: !94 = !{null, !24}
|
||||
// CHECK:STDOUT: !95 = !{!96}
|
||||
// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !92, type: !24)
|
||||
// CHECK:STDOUT: !97 = !DILocation(line: 20, column: 21, scope: !92)
|
||||
// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core", scope: null, file: !6, line: 19, type: !99, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !101)
|
||||
// CHECK:STDOUT: !99 = !DISubroutineType(types: !100)
|
||||
// CHECK:STDOUT: !100 = !{null, !14}
|
||||
// CHECK:STDOUT: !101 = !{!102}
|
||||
// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !98, type: !14)
|
||||
// CHECK:STDOUT: !103 = !DILocation(line: 19, column: 19, scope: !98)
|
||||
// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "Vars", linkageName: "_CVars.Main", scope: null, file: !6, line: 32, type: !68, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !105 = !DILocation(line: 33, column: 3, scope: !104)
|
||||
// CHECK:STDOUT: !106 = !DILocation(line: 34, column: 3, scope: !104)
|
||||
// CHECK:STDOUT: !107 = !DILocation(line: 35, column: 3, scope: !104)
|
||||
// CHECK:STDOUT: !108 = !DILocation(line: 36, column: 3, scope: !104)
|
||||
// CHECK:STDOUT: !109 = !DILocation(line: 38, column: 3, scope: !104)
|
||||
// CHECK:STDOUT: !110 = !DILocation(line: 39, column: 3, scope: !104)
|
||||
// CHECK:STDOUT: !111 = !DILocation(line: 40, column: 3, scope: !104)
|
||||
// CHECK:STDOUT: !112 = !DILocation(line: 41, column: 3, scope: !104)
|
||||
// CHECK:STDOUT: !113 = !DILocation(line: 33, column: 19, scope: !104)
|
||||
// CHECK:STDOUT: !114 = !DILocation(line: 34, column: 21, scope: !104)
|
||||
// CHECK:STDOUT: !115 = !DILocation(line: 35, column: 21, scope: !104)
|
||||
// CHECK:STDOUT: !116 = !DILocation(line: 36, column: 21, scope: !104)
|
||||
// CHECK:STDOUT: !117 = !DILocation(line: 38, column: 19, scope: !104)
|
||||
// CHECK:STDOUT: !118 = !DILocation(line: 39, column: 21, scope: !104)
|
||||
// CHECK:STDOUT: !119 = !DILocation(line: 40, column: 21, scope: !104)
|
||||
// CHECK:STDOUT: !120 = !DILocation(line: 41, column: 21, scope: !104)
|
||||
// CHECK:STDOUT: !121 = !DILocation(line: 43, column: 7, scope: !104)
|
||||
// CHECK:STDOUT: !122 = !DILocation(line: 43, column: 14, scope: !104)
|
||||
// CHECK:STDOUT: !123 = !DILocation(line: 43, column: 22, scope: !104)
|
||||
// CHECK:STDOUT: !124 = !DILocation(line: 43, column: 30, scope: !104)
|
||||
// CHECK:STDOUT: !125 = !DILocation(line: 43, column: 38, scope: !104)
|
||||
// CHECK:STDOUT: !126 = !DILocation(line: 43, column: 45, scope: !104)
|
||||
// CHECK:STDOUT: !127 = !DILocation(line: 43, column: 53, scope: !104)
|
||||
// CHECK:STDOUT: !128 = !DILocation(line: 43, column: 61, scope: !104)
|
||||
// CHECK:STDOUT: !129 = !DILocation(line: 43, column: 3, scope: !104)
|
||||
// CHECK:STDOUT: !130 = !DILocation(line: 32, column: 1, scope: !104)
|
||||
// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fbec46972c1998a0:core.Destroy.Core", scope: null, file: !6, line: 41, type: !132, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !134)
|
||||
// CHECK:STDOUT: !132 = !DISubroutineType(types: !133)
|
||||
// CHECK:STDOUT: !133 = !{null, !64}
|
||||
// CHECK:STDOUT: !134 = !{!135}
|
||||
// CHECK:STDOUT: !135 = !DILocalVariable(arg: 1, scope: !131, type: !64)
|
||||
// CHECK:STDOUT: !136 = !DILocation(line: 41, column: 3, scope: !131)
|
||||
// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !6, line: 40, type: !138, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !140)
|
||||
// CHECK:STDOUT: !138 = !DISubroutineType(types: !139)
|
||||
// CHECK:STDOUT: !139 = !{null, !58}
|
||||
// CHECK:STDOUT: !140 = !{!141}
|
||||
// CHECK:STDOUT: !141 = !DILocalVariable(arg: 1, scope: !137, type: !58)
|
||||
// CHECK:STDOUT: !142 = !DILocation(line: 40, column: 3, scope: !137)
|
||||
// CHECK:STDOUT: !143 = distinct !DISubprogram(name: "Op", linkageName: "_COp.df57f49075d1fe6b:core.Destroy.Core", scope: null, file: !6, line: 36, type: !144, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !146)
|
||||
// CHECK:STDOUT: !144 = !DISubroutineType(types: !145)
|
||||
// CHECK:STDOUT: !145 = !{null, !40}
|
||||
// CHECK:STDOUT: !146 = !{!147}
|
||||
// CHECK:STDOUT: !147 = !DILocalVariable(arg: 1, scope: !143, type: !40)
|
||||
// CHECK:STDOUT: !148 = !DILocation(line: 36, column: 3, scope: !143)
|
||||
// CHECK:STDOUT: !149 = distinct !DISubprogram(name: "Op", linkageName: "_COp.45ecfb19e8cc5ab3:core.Destroy.Core", scope: null, file: !6, line: 35, type: !150, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !152)
|
||||
// CHECK:STDOUT: !150 = !DISubroutineType(types: !151)
|
||||
// CHECK:STDOUT: !151 = !{null, !34}
|
||||
// CHECK:STDOUT: !152 = !{!153}
|
||||
// CHECK:STDOUT: !153 = !DILocalVariable(arg: 1, scope: !149, type: !34)
|
||||
// CHECK:STDOUT: !154 = !DILocation(line: 35, column: 3, scope: !149)
|
||||
// CHECK:STDOUT: ; ModuleID = 'import_class.carbon'
|
||||
// CHECK:STDOUT: source_filename = "import_class.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %struct.X = type { ptr, ptr }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CGetX.Main(ptr sret([16 x i8]) %return) #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %return), !dbg !15
|
||||
// CHECK:STDOUT: ret void, !dbg !16
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z4Makev.carbon_thunk.(ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !17
|
||||
// CHECK:STDOUT: call void @_Z4Makev(ptr dead_on_unwind writable sret(%struct.X) align 8 %0)
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CLet.Main() #0 !dbg !20 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.loc9_27.1.temp = alloca [16 x i8], align 8, !dbg !23
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_27.1.temp), !dbg !23
|
||||
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %.loc9_27.1.temp), !dbg !23
|
||||
// CHECK:STDOUT: call void @_ZN1XD1Ev(ptr %.loc9_27.1.temp), !dbg !23
|
||||
// CHECK:STDOUT: ret void, !dbg !24
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: declare void @_ZN1XD1Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16)) unnamed_addr #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CVar.Main() #0 !dbg !25 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !26
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !26
|
||||
// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %_.var), !dbg !27
|
||||
// CHECK:STDOUT: call void @_ZN1XD1Ev(ptr %_.var), !dbg !26
|
||||
// CHECK:STDOUT: ret void, !dbg !28
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z4Makev(ptr dead_on_unwind writable sret(%struct.X) align 8) #4
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 1, 0 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
||||
// CHECK:STDOUT: attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "import_class.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "GetX", linkageName: "_CGetX.Main", scope: null, file: !6, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !12 = !DISubroutineType(types: !13)
|
||||
// CHECK:STDOUT: !13 = !{!14}
|
||||
// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 29, scope: !11)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 22, scope: !11)
|
||||
// CHECK:STDOUT: !17 = !{!18, !18, i64 0}
|
||||
// CHECK:STDOUT: !18 = !{!"p1 _ZTS1X", !19, i64 0}
|
||||
// CHECK:STDOUT: !19 = !{!"any pointer", !9, i64 0}
|
||||
// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Let", linkageName: "_CLet.Main", scope: null, file: !6, line: 8, type: !21, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !21 = !DISubroutineType(types: !22)
|
||||
// CHECK:STDOUT: !22 = !{null}
|
||||
// CHECK:STDOUT: !23 = !DILocation(line: 9, column: 18, scope: !20)
|
||||
// CHECK:STDOUT: !24 = !DILocation(line: 8, column: 1, scope: !20)
|
||||
// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Var", linkageName: "_CVar.Main", scope: null, file: !6, line: 12, type: !21, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !26 = !DILocation(line: 13, column: 3, scope: !25)
|
||||
// CHECK:STDOUT: !27 = !DILocation(line: 13, column: 18, scope: !25)
|
||||
// CHECK:STDOUT: !28 = !DILocation(line: 12, column: 1, scope: !25)
|
||||
// CHECK:STDOUT: ; ModuleID = 'indirect_return_with_args.carbon'
|
||||
// CHECK:STDOUT: source_filename = "indirect_return_with_args.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: %class.D = type { i8 }
|
||||
// CHECK:STDOUT: %class.C = type { i8 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nounwind
|
||||
// CHECK:STDOUT: define void @_CCall.Main(ptr sret({}) %return, ptr %x) #0 !dbg !11 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: call void @_Z1f1D.carbon_thunk._(ptr %x, ptr %return), !dbg !17
|
||||
// CHECK:STDOUT: ret void, !dbg !18
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
|
||||
// CHECK:STDOUT: define internal void @_Z1f1D.carbon_thunk._(ptr noundef %0, ptr noundef %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: %agg.tmp = alloca %class.D, align 1
|
||||
// CHECK:STDOUT: %undef.agg.tmp = alloca %class.C, align 1
|
||||
// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !19
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !22
|
||||
// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !22
|
||||
// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !19
|
||||
// CHECK:STDOUT: call void @_Z1f1D()
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare void @_Z1f1D() #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nounwind }
|
||||
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
|
||||
// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "indirect_return_with_args.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = !{!8, !8, i64 0}
|
||||
// CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
|
||||
// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
|
||||
// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
|
||||
// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !6, line: 10, type: !12, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !15)
|
||||
// CHECK:STDOUT: !12 = !DISubroutineType(types: !13)
|
||||
// CHECK:STDOUT: !13 = !{!14, !14}
|
||||
// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
|
||||
// CHECK:STDOUT: !15 = !{!16}
|
||||
// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 11, column: 10, scope: !11)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 11, column: 3, scope: !11)
|
||||
// CHECK:STDOUT: !19 = !{!20, !20, i64 0}
|
||||
// CHECK:STDOUT: !20 = !{!"p1 _ZTS1D", !21, i64 0}
|
||||
// CHECK:STDOUT: !21 = !{!"any pointer", !9, i64 0}
|
||||
// CHECK:STDOUT: !22 = !{!23, !23, i64 0}
|
||||
// CHECK:STDOUT: !23 = !{!"p1 _ZTS1C", !21, i64 0}
|
||||
Reference in New Issue
Block a user