simple.carbon 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
  6. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/reverse/simple.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/reverse/simple.carbon
  12. // --- other.carbon
  13. package Other;
  14. namespace Nested;
  15. namespace Nested.Again;
  16. class Class1;
  17. // --- namespace.carbon
  18. library "[[@TEST_NAME]]";
  19. import Other;
  20. import Cpp inline '''
  21. namespace X = Carbon::Other;
  22. namespace Y = Carbon::Other::Nested;
  23. namespace Z = Carbon::Other::Nested::Again;
  24. Carbon::Other::Class1 *glbl;
  25. template<typename T> void f1() {
  26. T* v;
  27. }
  28. void f2() {
  29. f1<Carbon::Other::Class1>();
  30. }
  31. ''';