summaryrefslogtreecommitdiffstats
path: root/polly/lib/External/ppcg/tests/shared_sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/External/ppcg/tests/shared_sink.c')
-rw-r--r--polly/lib/External/ppcg/tests/shared_sink.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/polly/lib/External/ppcg/tests/shared_sink.c b/polly/lib/External/ppcg/tests/shared_sink.c
new file mode 100644
index 00000000000..ae3fac2fc1e
--- /dev/null
+++ b/polly/lib/External/ppcg/tests/shared_sink.c
@@ -0,0 +1,25 @@
+#include <stdlib.h>
+
+/* Check that the sources of live ranges with the same sink
+ * are executed in order.
+ */
+int main()
+{
+ int A[128];
+ int n = 128;
+
+ A[0] = 0;
+#pragma scop
+ for (int i = 0; i < n; ++i) {
+ int set = 0;
+ if (A[i] < 2)
+ set = 1;
+ if (set)
+ A[i] = 2;
+ }
+#pragma endscop
+ if (A[0] != 2)
+ return EXIT_FAILURE;
+
+ return EXIT_SUCCESS;
+}
OpenPOWER on IntegriCloud