1 ! Test that flang forwards the -f{no-,}version-loops-for-stride
2 ! options correctly to flang -fc1 for different variants of optimisation
5 ! RUN: %flang -### %s -o %t 2>&1 -O3 \
8 ! RUN: %flang -### %s -o %t 2>&1 -O2 \
9 ! RUN: | FileCheck %s --check-prefix=CHECK-O2
11 ! RUN: %flang -### %s -o %t 2>&1 -O2 -fversion-loops-for-stride \
12 ! RUN: | FileCheck %s --check-prefix=CHECK-O2-with
14 ! RUN: %flang -### %s -o %t 2>&1 -O4 \
15 ! RUN: | FileCheck %s --check-prefix=CHECK-O4
17 ! RUN: %flang -### %s -o %t 2>&1 -Ofast \
18 ! RUN: | FileCheck %s --check-prefix=CHECK-Ofast
20 ! RUN: %flang -### %s -o %t 2>&1 -Ofast -fno-version-loops-for-stride \
21 ! RUN: | FileCheck %s --check-prefix=CHECK-Ofast-no
23 ! RUN: %flang -### %s -o %t 2>&1 -O3 -fno-version-loops-for-stride \
24 ! RUN: | FileCheck %s --check-prefix=CHECK-O3-no
26 ! CHECK: "{{.*}}flang" "-fc1"
27 ! CHECK-SAME: "-fversion-loops-for-stride"
30 ! CHECK-O2: "{{.*}}flang" "-fc1"
31 ! CHECK-O2-NOT: "-fversion-loops-for-stride"
32 ! CHECK-O2-SAME: "-O2"
34 ! CHECK-O2-with: "{{.*}}flang" "-fc1"
35 ! CHECK-O2-with-SAME: "-fversion-loops-for-stride"
36 ! CHECK-O2-with-SAME: "-O2"
38 ! CHECK-O4: "{{.*}}flang" "-fc1"
39 ! CHECK-O4-SAME: "-fversion-loops-for-stride"
40 ! CHECK-O4-SAME: "-O3"
42 ! CHECK-Ofast: "{{.*}}flang" "-fc1"
43 ! CHECK-Ofast-SAME: "-ffast-math"
44 ! CHECK-Ofast-SAME: "-fversion-loops-for-stride"
45 ! CHECK-Ofast-SAME: "-O3"
47 ! CHECK-Ofast-no: "{{.*}}flang" "-fc1"
48 ! CHECK-Ofast-no-SAME: "-ffast-math"
49 ! CHECK-Ofast-no-NOT: "-fversion-loops-for-stride"
50 ! CHECK-Ofast-no-SAME: "-O3"
52 ! CHECK-O3-no: "{{.*}}flang" "-fc1"
53 ! CHECK-O3-no-NOT: "-fversion-loops-for-stride"
54 ! CHECK-O3-no-SAME: "-O3"