[clang] 97dcbd1 - Pre-commit test case for D136784

via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 27 01:57:29 PDT 2022


Author: eopXD
Date: 2022-10-27T01:57:24-07:00
New Revision: 97dcbd124d542f46313fdc28ae48ae0d4fd09ac7

URL: https://github.com/llvm/llvm-project/commit/97dcbd124d542f46313fdc28ae48ae0d4fd09ac7
DIFF: https://github.com/llvm/llvm-project/commit/97dcbd124d542f46313fdc28ae48ae0d4fd09ac7.diff

LOG: Pre-commit test case for D136784

This is a pre-commit for the fix in D136784.

Reviewed By: SjoerdMeijer

Differential Revision: https://reviews.llvm.org/D136783

Added: 
    

Modified: 
    clang/test/Parser/pragma-loop.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/Parser/pragma-loop.cpp b/clang/test/Parser/pragma-loop.cpp
index 456b4858f4ec5..750affbddf97e 100644
--- a/clang/test/Parser/pragma-loop.cpp
+++ b/clang/test/Parser/pragma-loop.cpp
@@ -301,3 +301,39 @@ const int VV = 4;
 void foo(void) {
 #pragma clang loop vectorize_predicate(enable)
 /* expected-error {{expected statement}} */ }
+
+void foo(int *List, int Length) {
+  int i;
+#pragma clang loop vectorize(enable, extra)
+/* expected-warning {{extra tokens at end of '#pragma clang loop loop' - ignored}}*/ while (i-6 < Length) {
+    List[i] = i;
+  }
+
+#pragma clang loop interleave(enable, extra)
+/* expected-warning {{extra tokens at end of '#pragma clang loop loop' - ignored}}*/ while (i-6 < Length) {
+    List[i] = i;
+  }
+
+#pragma clang loop unroll(enable, extra)
+/* expected-warning {{extra tokens at end of '#pragma clang loop loop' - ignored}}*/ while (i-6 < Length) {
+    List[i] = i;
+  }
+
+#pragma clang loop vectorize_predicate(enable, extra)
+/* expected-warning {{extra tokens at end of '#pragma clang loop loop' - ignored}}*/ while (i-6 < Length) {
+    List[i] = i;
+  }
+
+#pragma clang loop pipeline(disable, extra)
+/* expected-warning {{extra tokens at end of '#pragma clang loop loop' - ignored}}*/ while (i-6 < Length) {
+    List[i] = i;
+  }
+
+/* expected-warning {{extra tokens at end of '#pragma clang loop loop' - ignored}}*/ #pragma clang loop vectorize_width(2, scalable, extra)
+/* expected-warning {{extra tokens at end of '#pragma clang loop loop' - ignored}}*/ #pragma clang loop interleave_count(2, extra)
+/* expected-warning {{extra tokens at end of '#pragma clang loop loop' - ignored}}*/ #pragma clang loop unroll_count(2, extra)
+/* expected-warning {{extra tokens at end of '#pragma clang loop loop' - ignored}}*/ #pragma clang loop pipeline_initiation_interval(2, extra)
+  while (i-6 < Length) {
+    List[i] = i;
+  }
+}


        


More information about the cfe-commits mailing list