brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 76fecce Raw
85 lines · plain
1; RUN: rm -rf %t2; RUN: split-file %s %t3; RUN: sed -e "s|DSTROOT|%/t|g" %t/inputs.json.in > %t/inputs.json4; RUN: mkdir -p %t/modules.cache5 6; RUN: clang-installapi \7; RUN: -target arm64-apple-macos12 -install_name @rpath/libfoo.dylib \8; RUN: -current_version 1 -compatibility_version 1 \9; RUN: -Xproject -fmodules -I%t/usr/include \10; RUN: -Xproject -fmodules-cache-path=%t/modules.cache \11; RUN: -F %S/Inputs/Foundation/ \12; RUN: -exclude-public-header %t/usr/include/public.h \13; RUN: -extra-project-header %t/project.h -I%t -dynamiclib \14; RUN: %t/inputs.json \15; RUN: -o %t/output.tbd 2>&1 | FileCheck %s --allow-empty16; RUN: llvm-readtapi --compare %t/output.tbd %t/expected.tbd 2>&1 | FileCheck %s --allow-empty17 18; RUN: not clang-installapi \19; RUN: -target arm64-apple-macos12 -install_name @rpath/libfoo.dylib \20; RUN: -current_version 1 -compatibility_version 1 \21; RUN: -Xproject -fmodules -I%t/usr/include \22; RUN: -Xproject -fmodules-cache-path=%t/modules.cache \23; RUN: -extra-project-header %t/project.h \24; RUN: -F %S/Inputs/Foundation/ \25; RUN: %t/inputs.json \26; RUN: -I%t -dynamiclib -o %t/output.tbd 2>&1 | FileCheck %s --check-prefix=PUBLIC27 28; CHECK-NOT: error29; CHECK-NOT: warning30 31; PUBLIC: public.h:1:1: error: use of '@import' when modules are disabled32; PUBLIC-NEXT: @import Foundation;33 34//--- usr/include/public.h35@import Foundation;36extern int foo();37 38//--- project.h39@import Foundation;40extern int bar();41 42//--- expected.tbd43{44  "main_library": {45    "exported_symbols": [46      {47        "text": {48          "global": [49            "_bar"50          ]51        }52      }53    ],54    "flags": [55      {56        "attributes": [57          "not_app_extension_safe"58        ]59      }60    ],61    "install_names": [62      {63        "name": "@rpath/libfoo.dylib"64      }65    ],66    "target_info": [67      {68        "min_deployment": "12",69        "target": "arm64-macos"70      }71    ]72  },73  "tapi_tbd_version": 574}75 76;--- inputs.json.in77{78  "headers": [ {79    "path" : "DSTROOT/usr/include/public.h",80    "type" : "public"81  }82  ],83  "version": "3"84}85