llvm-project/clang/test/InterfaceStubs/bad-format.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
2.2 KiB
C++
Raw Normal View History

// RUN: not %clang -emit-interface-stubs -interface-stub-version=bad-format %s 2>&1 | \
// RUN: FileCheck %s
[clang-ifs] Clang Interface Stubs, first version (second landing attempt). This change reverts r363649; effectively re-landing r363626. At this point clang::Index::CodegenNameGeneratorImpl has been refactored into clang::AST::ASTNameGenerator. This makes it so that the previous circular link dependency no longer exists, fixing the previous share lib (-DBUILD_SHARED_LIBS=ON) build issue which was the reason for r363649. Clang interface stubs (previously referred to as clang-ifsos) is a new frontend action in clang that allows the generation of stub files that contain mangled name info that can be used to produce a stub library. These stub libraries can be useful for breaking up build dependencies and controlling access to a library's internal symbols. Generation of these stubs can be invoked by: clang -fvisibility=<visibility> -emit-interface-stubs \ -interface-stub-version=<interface format> Notice that -fvisibility (along with use of visibility attributes) can be used to control what symbols get generated. Currently the interface format is experimental but there are a wide range of possibilities here. Currently clang-ifs produces .ifs files that can be thought of as analogous to object (.o) files, but just for the mangled symbol info. In a subsequent patch I intend to add support for merging the .ifs files into one .ifs/.ifso file that can be the input to something like llvm-elfabi to produce something like a .so file or .dll (but without any of the code, just symbols). Differential Revision: https://reviews.llvm.org/D60974 llvm-svn: 363948
2019-06-21 00:59:48 +08:00
// RUN: not %clang -emit-interface-stubs -interface-stub-version=experimental-tapi-elf-v1 %s 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-TAPI-DEPRECATED %s
// RUN: not %clang -emit-interface-stubs -interface-stub-version=experimental-yaml-elf-v1 %s 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-YAML-DEPRECATED %s
// RUN: not %clang -emit-interface-stubs -interface-stub-version=experimental-ifs-v1 %s 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-V1-DEPRECATED %s
// RUN: not %clang -emit-interface-stubs -interface-stub-version=bad-format %s 2>&1 | \
// RUN: FileCheck %s
// RUN: not %clang -emit-interface-stubs \
// RUN: -interface-stub-version=experimental-tapi-elf-v1 %s 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-TAPI-DEPRECATED %s
// RUN: not %clang -emit-interface-stubs \
// RUN: -interface-stub-version=experimental-yaml-elf-v1 %s 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-YAML-DEPRECATED %s
[clang-ifs] Clang Interface Stubs, first version (second landing attempt). This change reverts r363649; effectively re-landing r363626. At this point clang::Index::CodegenNameGeneratorImpl has been refactored into clang::AST::ASTNameGenerator. This makes it so that the previous circular link dependency no longer exists, fixing the previous share lib (-DBUILD_SHARED_LIBS=ON) build issue which was the reason for r363649. Clang interface stubs (previously referred to as clang-ifsos) is a new frontend action in clang that allows the generation of stub files that contain mangled name info that can be used to produce a stub library. These stub libraries can be useful for breaking up build dependencies and controlling access to a library's internal symbols. Generation of these stubs can be invoked by: clang -fvisibility=<visibility> -emit-interface-stubs \ -interface-stub-version=<interface format> Notice that -fvisibility (along with use of visibility attributes) can be used to control what symbols get generated. Currently the interface format is experimental but there are a wide range of possibilities here. Currently clang-ifs produces .ifs files that can be thought of as analogous to object (.o) files, but just for the mangled symbol info. In a subsequent patch I intend to add support for merging the .ifs files into one .ifs/.ifso file that can be the input to something like llvm-elfabi to produce something like a .so file or .dll (but without any of the code, just symbols). Differential Revision: https://reviews.llvm.org/D60974 llvm-svn: 363948
2019-06-21 00:59:48 +08:00
// CHECK: error: invalid value
// CHECK: 'Invalid interface stub format: bad-format.' in 'Must specify a
// CHECK: valid interface stub format type, ie:
// CHECK: -interface-stub-version=experimental-ifs-v2'
// CHECK-TAPI-DEPRECATED: error: invalid value
// CHECK-TAPI-DEPRECATED: 'Invalid interface stub format:
// CHECK-TAPI-DEPRECATED: experimental-tapi-elf-v1 is deprecated.' in 'Must
// CHECK-TAPI-DEPRECATED: specify a valid interface stub format type, ie:
// CHECK-TAPI-DEPRECATED: -interface-stub-version=experimental-ifs-v2'
// CHECK-YAML-DEPRECATED: error: invalid value
// CHECK-YAML-DEPRECATED: 'Invalid interface stub format:
// CHECK-YAML-DEPRECATED: experimental-yaml-elf-v1 is deprecated.' in 'Must
// CHECK-YAML-DEPRECATED: specify a valid interface stub format type, ie:
// CHECK-YAML-DEPRECATED: -interface-stub-version=experimental-ifs-v2'
// CHECK-V1-DEPRECATED: error: invalid value
// CHECK-V1-DEPRECATED: 'Invalid interface stub format:
// CHECK-V1-DEPRECATED: experimental-ifs-v1 is deprecated.' in 'Must
// CHECK-V1-DEPRECATED: specify a valid interface stub format type, ie:
// CHECK-V1-DEPRECATED: -interface-stub-version=experimental-ifs-v2'