16 lines · c
1// REQUIRES: system-darwin && target={{.*}}-{{darwin|macos}}{{.*}}2 3// RUN: rm -rf %t && mkdir -p %t4// RUN: %clang -fdriver-only -o %t/out %s -mtargetos=macos12 -arch arm64 -arch x86_64 -MJ %t/compilation_database.json5 6// Let's run that again and verify we're not accumulating redundant entries in the same file.7//8// RUN: %clang -fdriver-only -o %t/out %s -mtargetos=macos12 -arch arm64 -arch x86_64 -MJ %t/compilation_database.json9// RUN: echo EOF >> %t/compilation_database.json10 11// RUN: FileCheck --input-file=%t/compilation_database.json %s12 13// CHECK-DAG: { "directory": "{{.*}}", "file": "{{.*}}", "output": "[[OUTPUT_X86_64:.*]]", "arguments": [{{.*}}, "-o", "[[OUTPUT_X86_64]]", {{.*}} "--target=x86_64-apple-macosx12.0.0"]},14// CHECK-DAG: { "directory": "{{.*}}", "file": "{{.*}}", "output": "[[OUTPUT_ARM64:.*]]", "arguments": [{{.*}}, "-o", "[[OUTPUT_ARM64]]", {{.*}} "--target=arm64-apple-macosx12.0.0"]},15// CHECK: EOF16