================
@@ -0,0 +1,30 @@
+! Test to check the working of option "-fprofile-sample-use".
+
+! RUN: %flang -### -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s 2>&1 | 
FileCheck %s --check-prefix=PROFILE-SAMPLE-USE
+! RUN: %flang -### %s 2>&1 | FileCheck %s --check-prefix=NO-PROFILE-SAMPLE-USE
+! RUN: %flang -### -fprofile-sample-use=%S/Inputs/pgo-sample.prof 
-fno-profile-sample-use %s 2>&1 | FileCheck %s 
--check-prefix=NO-PROFILE-SAMPLE-USE
+! RUN: %flang -### -fno-profile-sample-use %s 2>&1 | FileCheck %s 
--check-prefix=NO-PROFILE-SAMPLE-USE
+! RUN: not %flang -fsyntax-only -fprofile-sample-use=%t/missing-profile.prof 
%s 2>&1 | FileCheck %s --check-prefix=PROFILE-SAMPLE-USE-NO-FILE
+! RUN: not %flang -fsyntax-only -fprofile-generate 
-fprofile-sample-use=%S/Inputs/pgo-sample.prof %s 2>&1 | FileCheck %s 
--check-prefix=PROFILE-SAMPLE-USE-ERROR
----------------
tarunprabhu wrote:

Seriously big nit: This is just reorganizing the tests so they start with the 
default and proceeding from simple to more complex combinations of options. 
This made it easier to review, and, arguably, is easier to read when needed.

```suggestion
! RUN: %flang -### %s 2>&1 | FileCheck %s --check-prefix=NO-PROFILE-SAMPLE-USE
! RUN: %flang -### -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s 2>&1 | 
FileCheck %s --check-prefix=PROFILE-SAMPLE-USE
! RUN: %flang -### -fno-profile-sample-use %s 2>&1 | FileCheck %s 
--check-prefix=NO-PROFILE-SAMPLE-USE

! RUN: %flang -### -fprofile-sample-use=%S/Inputs/pgo-sample.prof 
-fno-profile-sample-use %s 2>&1 | FileCheck %s 
--check-prefix=NO-PROFILE-SAMPLE-USE

! RUN: not %flang -fsyntax-only -fprofile-sample-use=%t/missing-profile.prof %s 
2>&1 | FileCheck %s --check-prefix=PROFILE-SAMPLE-USE-NO-FILE
! RUN: not %flang -fsyntax-only -fprofile-generate 
-fprofile-sample-use=%S/Inputs/pgo-sample.prof %s 2>&1 | FileCheck %s 
--check-prefix=PROFILE-SAMPLE-USE-ERROR
```

https://github.com/llvm/llvm-project/pull/188697
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to