[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Driver / cxx20-header-units-02.cpp
blob7b7a40f9e831fa5662de2347627f0ad9fab25c57
1 // Test user-facing command line options to generate C++20 header units.
3 // RUN: %clang -### -std=c++20 -fmodule-header=user foo.hh 2>&1 | \
4 // RUN: FileCheck -check-prefix=CHECK-USER %s
6 // RUN: %clang -### -std=c++20 -fmodule-header=user foo.h 2>&1 | \
7 // RUN: FileCheck -check-prefix=CHECK-USER1 %s
9 // RUN: %clang -### -std=c++20 -fmodule-header=system foo.hh 2>&1 | \
10 // RUN: FileCheck -check-prefix=CHECK-SYS1 %s
12 // RUN: %clang -### -std=c++20 -fmodule-header=system \
13 // RUN: -xc++-system-header vector 2>&1 | FileCheck -check-prefix=CHECK-SYS2 %s
15 // RUN: %clang -### -std=c++20 -fmodule-header=system \
16 // RUN: -xc++-header vector 2>&1 | FileCheck -check-prefix=CHECK-SYS2 %s
18 // RUN: %clang -### -std=c++20 -fmodule-header %/S/Inputs/header-unit-01.hh \
19 // RUN: 2>&1 | FileCheck -check-prefix=CHECK-ABS %s -DTDIR=%/S/Inputs
21 // CHECK-USER: "-emit-header-unit"
22 // CHECK-USER-SAME: "-o" "foo.pcm"
23 // CHECK-USER-SAME: "-x" "c++-user-header" "foo.hh"
25 // CHECK-USER1: "-emit-header-unit"
26 // CHECK-USER1-SAME: "-o" "foo.pcm"
27 // CHECK-USER1-SAME: "-x" "c++-user-header" "foo.h"
29 // CHECK-SYS1: "-emit-header-unit"
30 // CHECK-SYS1-SAME: "-o" "foo.pcm"
31 // CHECK-SYS1-SAME: "-x" "c++-system-header" "foo.hh"
33 // CHECK-SYS2: "-emit-header-unit"
34 // CHECK-SYS2-SAME: "-o" "vector.pcm"
35 // CHECK-SYS2-SAME: "-x" "c++-system-header" "vector"
37 // CHECK-ABS: "-emit-header-unit"
38 // CHECK-ABS-SAME: "-o" "header-unit-01.pcm"
39 // CHECK-ABS-SAME: "-x" "c++-header-unit-header" "[[TDIR]]/header-unit-01.hh"