brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 34d5949 Raw
89 lines · c
1// This test checks that VFS-mapped module map path has the correct spelling2// after canonicalization, even if it was first accessed using different case.3 4// RUN: rm -rf %t5// RUN: split-file %s %t6 7//--- actual/One.h8#import <FW/Two.h>9//--- actual/Two.h10// empty11//--- frameworks/FW.framework/Modules/module.modulemap12framework module FW {13  header "One.h"14  header "Two.h"15}16//--- tu.m17#import <fw/One.h>18 19//--- overlay.json.in20{21  "version": 0,22  "case-sensitive": "false",23  "roots": [24    {25      "contents": [26        {27          "external-contents": "DIR/actual/One.h",28          "name": "One.h",29          "type": "file"30        },31        {32          "external-contents": "DIR/actual/Two.h",33          "name": "Two.h",34          "type": "file"35        }36      ],37      "name": "DIR/frameworks/FW.framework/Headers",38      "type": "directory"39    },40    {41      "contents": [42        {43          "external-contents": "DIR/frameworks/FW.framework/Modules/module.modulemap",44          "name": "module.modulemap",45          "type": "file"46        }47      ],48      "name": "DIR/frameworks/FW.framework/Modules",49      "type": "directory"50    }51  ]52}53 54//--- cdb.json.in55[{56  "directory": "DIR",57  "file": "DIR/tu.m",58  "command": "clang -fmodules -fmodules-cache-path=DIR/cache -ivfsoverlay DIR/overlay.json -F DIR/frameworks -c DIR/tu.m -o DIR/tu.o"59}]60 61// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.in > %t/cdb.json62// RUN: sed -e "s|DIR|%/t|g" %t/overlay.json.in > %t/overlay.json63// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full > %t/result.json64// RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t65 66// CHECK:      {67// CHECK-NEXT:   "modules": [68// CHECK-NEXT:     {69// CHECK-NEXT:       "clang-module-deps": [],70// CHECK-NEXT:       "clang-modulemap-file": "[[PREFIX]]/frameworks/FW.framework/Modules/module.modulemap",71// CHECK-NEXT:       "command-line": [72// CHECK:              "-x"73// CHECK-NEXT:         "objective-c"74// CHECK-NEXT:         "[[PREFIX]]/frameworks/FW.framework/Modules/module.modulemap"75// CHECK:            ],76// CHECK-NEXT:       "context-hash": "{{.*}}",77// CHECK-NEXT:       "file-deps": [78// CHECK:            ],79// CHECK-NEXT:       "link-libraries": [80// CHECK-NEXT:         {81// CHECK-NEXT:           "isFramework": true,82// CHECK-NEXT:           "link-name": "FW"83// CHECK-NEXT:         }84// CHECK-NEXT:       ],85// CHECK-NEXT:       "name": "FW"86// CHECK-NEXT:     }87// CHECK-NEXT:   ]88// CHECK:      }89