2 // RUN: split-file %s %t
3 // RUN: sed -e "s|DIR|%/t|g" %t/cdb1.json.template > %t/cdb1.json
5 // RUN: clang-scan-deps -compilation-database %t/cdb1.json -format experimental-full > %t/result1.txt
6 // RUN: FileCheck %s -input-file %t/result1.txt
8 // This tests that codegen option that do not affect the AST or generation of a
9 // module are removed. It also tests that the optimization options that affect
10 // the AST are not reset to -O0.
12 // CHECK: "modules": [
14 // CHECK: "command-line": [
17 // CHECK-NOT: "-fno-autolink"
18 // CHECK-NOT: "-mrelax-relocations=no"
22 // CHECK-NOT: "name": "A"
23 // CHECK: "translation-units"
25 //--- cdb1.json.template
29 "command": "clang -Imodules/A -fmodules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -O2 -flto -fno-autolink -Xclang -mrelax-relocations=no -fsyntax-only DIR/t1.m",
34 "command": "clang -Imodules/A -fmodules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -O2 -flto=thin -fautolink -fsyntax-only DIR/t2.m",
39 "command": "clang -Imodules/A -fmodules -fmodules-cache-path=DIR/module-cache -fimplicit-modules -O2 -flto=full -fsyntax-only DIR/t3.m",
44 //--- modules/A/module.modulemap