| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- // 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
- //
- // AUTOUPDATE
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/no_prelude/export_name.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/export_name.carbon
- // ============================================================================
- // Setup files
- // ============================================================================
- // --- base.carbon
- library "base";
- interface I {}
- // --- export.carbon
- library "export";
- import library "base";
- export I;
- // ============================================================================
- // Test files
- // ============================================================================
- // --- use_export.carbon
- library "use_export";
- import library "export";
- fn UseEmpty(i: I) {}
- // CHECK:STDOUT: --- base.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %.1: type = interface_type @I [template]
- // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .I = %I.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface @I {
- // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = %Self
- // CHECK:STDOUT: witness = ()
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- export.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %.1: type = interface_type @I [template]
- // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .I = %I
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%.1]
- // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+3, unloaded
- // CHECK:STDOUT: %I: type = export I, %import_ref.1 [template = constants.%.1]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface @I {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = file.%import_ref.2
- // CHECK:STDOUT: witness = ()
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- use_export.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %.1: type = interface_type @I [template]
- // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic]
- // CHECK:STDOUT: %UseEmpty.type: type = fn_type @UseEmpty [template]
- // CHECK:STDOUT: %.2: type = tuple_type () [template]
- // CHECK:STDOUT: %UseEmpty: %UseEmpty.type = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .I = %import_ref.1
- // CHECK:STDOUT: .UseEmpty = %UseEmpty.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+6, loaded [template = constants.%.1]
- // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+5, unloaded
- // CHECK:STDOUT: %UseEmpty.decl: %UseEmpty.type = fn_decl @UseEmpty [template = constants.%UseEmpty] {
- // CHECK:STDOUT: %I.ref: type = name_ref I, %import_ref.1 [template = constants.%.1]
- // CHECK:STDOUT: %i.loc6_13.1: %.1 = param i
- // CHECK:STDOUT: @UseEmpty.%i: %.1 = bind_name i, %i.loc6_13.1
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface @I {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = file.%import_ref.2
- // CHECK:STDOUT: witness = ()
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @UseEmpty(%i: %.1) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
|