|
| 1 | +// It is annoying to handle different slash direction |
| 2 | +// in Windows and Linux. So we disable the test on Windows |
| 3 | +// here. |
| 4 | +// REQUIRES: !system-windows |
| 5 | +// On AIX, the default output for `-c` may be `.s` instead of `.o`, |
| 6 | +// which makes the test fail. So disable the test on AIX. |
| 7 | +// UNSUPPORTED: system-aix |
| 8 | +// |
| 9 | +// RUN: rm -rf %t && split-file %s %t && cd %t |
| 10 | +// |
| 11 | +// RUN: %clang -std=c++20 Hello.cppm -fmodule-output=Hello.pcm \ |
| 12 | +// RUN: -fexperimental-modules-reduced-bmi -c -o Hello.o -### 2>&1 | FileCheck Hello.cppm |
| 13 | +// |
| 14 | +// RUN: %clang -std=c++20 Hello.cppm \ |
| 15 | +// RUN: -fexperimental-modules-reduced-bmi -c -o Hello.o -### 2>&1 | \ |
| 16 | +// RUN: FileCheck Hello.cppm --check-prefix=CHECK-UNSPECIFIED |
| 17 | +// |
| 18 | +// RUN: %clang -std=c++20 Hello.cppm \ |
| 19 | +// RUN: -fexperimental-modules-reduced-bmi -c -### 2>&1 | \ |
| 20 | +// RUN: FileCheck Hello.cppm --check-prefix=CHECK-NO-O |
| 21 | +// |
| 22 | +// RUN: %clang -std=c++20 Hello.cppm \ |
| 23 | +// RUN: -fexperimental-modules-reduced-bmi -c -o AnotherName.o -### 2>&1 | \ |
| 24 | +// RUN: FileCheck Hello.cppm --check-prefix=CHECK-ANOTHER-NAME |
| 25 | +// |
| 26 | +// RUN: %clang -std=c++20 Hello.cppm --precompile -fexperimental-modules-reduced-bmi \ |
| 27 | +// RUN: -o Hello.full.pcm -### 2>&1 | FileCheck Hello.cppm \ |
| 28 | +// RUN: --check-prefix=CHECK-EMIT-MODULE-INTERFACE |
| 29 | +// |
| 30 | +// RUN: %clang -std=c++20 Hello.cc -fexperimental-modules-reduced-bmi -Wall -Werror \ |
| 31 | +// RUN: -c -o Hello.o -### 2>&1 | FileCheck Hello.cc |
| 32 | + |
| 33 | +//--- Hello.cppm |
| 34 | +export module Hello; |
| 35 | + |
| 36 | +// Test that we won't generate the emit-module-interface as 2 phase compilation model. |
| 37 | +// CHECK-NOT: -emit-module-interface |
| 38 | +// CHECK: "-fexperimental-modules-reduced-bmi" |
| 39 | + |
| 40 | +// CHECK-UNSPECIFIED: -fmodule-output=Hello.pcm |
| 41 | + |
| 42 | +// CHECK-NO-O: -fmodule-output=Hello.pcm |
| 43 | +// CHECK-ANOTHER-NAME: -fmodule-output=AnotherName.pcm |
| 44 | + |
| 45 | +// With `-emit-module-interface` specified, we should still see the `-emit-module-interface` |
| 46 | +// flag. |
| 47 | +// CHECK-EMIT-MODULE-INTERFACE: -emit-module-interface |
| 48 | + |
| 49 | +//--- Hello.cc |
| 50 | + |
| 51 | +// CHECK-NOT: "-fexperimental-modules-reduced-bmi" |
0 commit comments