1 // Check that we get canonical round-trippable command-lines, in particular
2 // for the options modified for modules.
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": [
20 // CHECK: "clang-module-deps": []
21 // CHECK: "command-line": [
22 // CHECK: "-ffast-math"
24 // CHECK: "name": "Mod"
27 // CHECK: "translation-units": [
29 // CHECK-NEXT: "commands": [
31 // CHECK: "command-line": [
32 // CHECK: "-ffast-math"
35 //--- cdb.json.template
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" }