summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/compilation_database.c
blob: bb6c9c7599ea09d66f53beb96435e6b191fc6d24 (plain)
1
2
3
4
5
6
7
8
9
10
// RUN: %clang -MD -MP -c -x c %s -xc++ %s -Wall -MJ - 2>&1 | FileCheck %s
// RUN: not %clang -c -x c %s -MJ %s/non-existant 2>&1 | FileCheck --check-prefix=ERROR %s

// CHECK: { "directory": "[[CWD:[^"]+]]",  "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc", "[[SRC]]", "-c", "-Wall", "--target={{[^"]+}}"]},
// CHECK: { "directory": "[[CWD:[^"]+]]",  "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc++", "[[SRC]]", "-c", "-Wall", "--target={{[^"]+}}"]},
// ERROR: error: compilation database '{{.*}}/non-existant' could not be opened:

int main(void) {
  return 0;
}
OpenPOWER on IntegriCloud