brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 515cc44 Raw
47 lines · c
1// Check that we get canonical round-trippable command-lines, in particular2// for the options modified for modules.3 4// RUN: rm -rf %t5// RUN: split-file %s %t6// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json7 8// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full -round-trip-args > %t/result.json9// RUN: cat %t/result.json  | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t --check-prefixes=CHECK,NEGATIVE10 11// -ffast-math implies -menable-no-infs, -menable-no-nans, and -mreassociate;12// those options are modified by resetNonModularOptions.13 14// NEGATIVE-NOT: "-menable-no-infs"15// NEGATIVE-NOT: "-menable-no-nans"16// NEGATIVE-NOT: "-mreassociate"17 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:              ]34 35//--- cdb.json.template36[{37  "file": "DIR/tu.c",38  "directory": "DIR",39  "command": "clang -fsyntax-only DIR/tu.c -fmodules -fmodules-cache-path=DIR/cache -ffast-math"40}]41 42//--- module.modulemap43module Mod { header "mod.h" }44//--- mod.h45//--- tu.c46#include "mod.h"47