[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / ClangScanDeps / modules-implied-args.c
blob515cc4463e6a6c62641047ab4e00c60fdc7af810
1 // Check that we get canonical round-trippable command-lines, in particular
2 // for the options modified for modules.
4 // RUN: rm -rf %t
5 // RUN: split-file %s %t
6 // RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
8 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full -round-trip-args > %t/result.json
9 // RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t --check-prefixes=CHECK,NEGATIVE
11 // -ffast-math implies -menable-no-infs, -menable-no-nans, and -mreassociate;
12 // those options are modified by resetNonModularOptions.
14 // NEGATIVE-NOT: "-menable-no-infs"
15 // NEGATIVE-NOT: "-menable-no-nans"
16 // NEGATIVE-NOT: "-mreassociate"
18 // CHECK: "modules": [
19 // CHECK-NEXT: {
20 // CHECK: "clang-module-deps": []
21 // CHECK: "command-line": [
22 // CHECK: "-ffast-math"
23 // CHECK: ]
24 // CHECK: "name": "Mod"
25 // CHECK: }
26 // CHECK-NEXT: ]
27 // CHECK: "translation-units": [
28 // CHECK-NEXT: {
29 // CHECK-NEXT: "commands": [
30 // CHECK: {
31 // CHECK: "command-line": [
32 // CHECK: "-ffast-math"
33 // CHECK: ]
35 //--- cdb.json.template
37 "file": "DIR/tu.c",
38 "directory": "DIR",
39 "command": "clang -fsyntax-only DIR/tu.c -fmodules -fmodules-cache-path=DIR/cache -ffast-math"
42 //--- module.modulemap
43 module Mod { header "mod.h" }
44 //--- mod.h
45 //--- tu.c
46 #include "mod.h"