62 lines · c
1// RUN: rm -rf %t2// RUN: split-file %s %t3 4//--- cdb.json.template5[6 {7 "directory": "DIR",8 "command": "clang -c DIR/tu.c -fmodules -target i386-apple-ios14.0-simulator -fmodules-cache-path=DIR/cache -Wno-error=invalid-ios-deployment-target -o DIR/tu.o",9 "file": "DIR/tu.c"10 }11]12//--- mod.h13//--- module.modulemap14module mod { header "mod.h" }15//--- tu.c16#include "mod.h"17 18// RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json19// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full 2>&1 > %t/result.json20// RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t21 22// Check that the '-Wno-error=invalid-ios-deployment-target' option is being23// respected and invalid arguments like '-target i386-apple-ios14.0-simulator'24// do not result in an error.25 26// CHECK-NOT: error:27// CHECK: {28// CHECK-NEXT: "modules": [29// CHECK-NEXT: {30// CHECK-NEXT: "clang-module-deps": [],31// CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",32// CHECK-NEXT: "command-line": [33// CHECK-NEXT: "-cc1"34// CHECK: ],35// CHECK-NEXT: "context-hash": "[[HASH_MOD:.*]]",36// CHECK-NEXT: "file-deps": [37// CHECK-NEXT: "[[PREFIX]]/module.modulemap",38// CHECK-NEXT: "[[PREFIX]]/mod.h"39// CHECK-NEXT: ],40// CHECK-NEXT: "link-libraries": [],41// CHECK-NEXT: "name": "mod"42// CHECK-NEXT: }43// CHECK-NEXT: ],44// CHECK-NEXT: "translation-units": [45// CHECK-NEXT: {46// CHECK: "clang-context-hash": "[[HASH_TU:.*]],47// CHECK-NEXT: "clang-module-deps": [48// CHECK-NEXT: {49// CHECK-NEXT: "context-hash": "[[HASH_MOD]]",50// CHECK-NEXT: "module-name": "mod"51// CHECK-NEXT: }52// CHECK-NEXT: ],53// CHECK-NEXT: "command-line": [54// CHECK-NOT: "-fimplicit-modules"55// CHECK-NOT: "-fimplicit-module-maps"56// CHECK: ],57// CHECK: "file-deps": [58// CHECK-NEXT: "[[PREFIX]]/tu.c"59// CHECK-NEXT: ],60// CHECK-NEXT: "input-file": "[[PREFIX]]/tu.c"61// CHECK-NEXT: }62