File: unit-with-explicit-output-path.c

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (46 lines) | stat: -rw-r--r-- 2,409 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "print-unit.h"
#include "syshead.h"

void foo(int i);

// RUN: rm -rf %t
// RUN: %clang_cc1 -I %S/Inputs -isystem %S/Inputs/sys -index-store-path %t/idx %s -triple x86_64-apple-macosx10.8
// RUN: c-index-test core -print-unit %t/idx | FileCheck --check-prefixes=DEFAULT,ALL %s
// RUN: %clang_cc1 -I %S/Inputs -isystem %S/Inputs/sys -index-store-path %t/idx_opt1 %s -triple x86_64-apple-macosx10.8 -o %t/unit-with-explicit-output-path.o
// RUN: c-index-test core -print-unit %t/idx_opt1 | FileCheck %s -check-prefixes=OUT,ALL
// RUN: %clang_cc1 -I %S/Inputs -isystem %S/Inputs/sys -index-store-path %t/idx_opt2 %s -triple x86_64-apple-macosx10.8 -index-unit-output-path custom-unit.o
// RUN: c-index-test core -print-unit %t/idx_opt2 | FileCheck %s -check-prefixes=UNITOUT,ALL

// DEFAULT: unit-with-explicit-output-path.c.o
// OUT: unit-with-explicit-output-path.o
// UNITOUT: custom-unit.o
// ALL: provider: clang-
// ALL: is-system: 0
// ALL: has-main: 1
// ALL: main-path: {{.*}}{{/|\\}}unit-with-explicit-output-path.c
// DEFAULT: out-file: {{.*}}{{/|\\}}unit-with-explicit-output-path.c.o
// OUT: out-file: {{.*}}{{/|\\}}unit-with-explicit-output-path.o
// UNITOUT: out-file: {{.*}}{{/|\\}}custom-unit.o
// ALL: target: x86_64-apple-macosx10.8
// ALL: is-debug: 1


// RUN: %clang_cc1 -I %S/Inputs -isystem %S/Inputs/sys -index-store-path %t/idx_same %s -triple x86_64-apple-macosx10.8 -o %t/dir1/out.o -index-unit-output-path %t/custom-unit.o
// RUN: %clang_cc1 -I %S/Inputs -isystem %S/Inputs/sys -index-store-path %t/idx_same %s -triple x86_64-apple-macosx10.8 -o %t/dir2/out.o -index-unit-output-path %t/custom-unit.o
// RUN: c-index-test core -print-unit %t/idx_same | FileCheck %s -check-prefixes=SINGLE

// Make sure there's only one unit file produced even though both invocations had different -o paths.
// SINGLE-NOT: --------
// SINGLE: custom-unit.o-{{.*}}
// SINGLE-NEXT: --------
// SINGLE-NOT: --------

// RUN: %clang_cc1 -I %S/Inputs -isystem %S/Inputs/sys -index-store-path %t/idx_same %s -triple x86_64-apple-macosx10.8 -o %t/dir2/out.o -index-unit-output-path %t/custom-unit2.o
// RUN: c-index-test core -print-unit %t/idx_same | FileCheck %s -check-prefixes=TWOUNITS

// Make sure there are two unit files now, as we had a different unit output path.

// TWOUNITS: custom-unit.o-{{.*}}
// TWOUNITS-NEXT: --------
// TWOUNITS: custom-unit2.o-{{.*}}
// TWOUNITS-NEXT: --------