Commit 81609c80 authored by Mark Florisson's avatar Mark Florisson

Issue compiler warning for unsigned prange target (not allowed in omp < 3.0)

parent 30ba2ac1
......@@ -7847,6 +7847,10 @@ class ParallelRangeNode(ParallelStatNode):
self.index_type = PyrexTypes.c_py_ssize_t_type
else:
self.index_type = self.target.type
if not self.index_type.signed:
warning(self.target.pos,
"Unsigned index type not allowed before OpenMP 3.0",
level=2)
# Setup start, stop and step, allocating temps if needed
self.names = 'start', 'stop', 'step'
......
......@@ -65,25 +65,26 @@ def test_propagation():
return i, j, x, y, sum1, sum2
def test_unsigned_operands():
"""
>>> test_unsigned_operands()
10
"""
cdef int i
cdef int start = -5
cdef unsigned int stop = 5
cdef int step = 1
cdef int steps_taken = 0
cdef int *steps_takenp = &steps_taken
for i in prange(start, stop, step, nogil=True):
steps_taken += 1
if steps_takenp[0] > 10:
abort()
return steps_taken
# DISABLED, not allowed in OpenMP 3.0 (fails on Windows)
#def test_unsigned_operands():
# """
# >>> test_unsigned_operands()
# 10
# """
# cdef int i
# cdef int start = -5
# cdef unsigned int stop = 5
# cdef int step = 1
#
# cdef int steps_taken = 0
# cdef int *steps_takenp = &steps_taken
#
# for i in prange(start, stop, step, nogil=True):
# steps_taken += 1
# if steps_takenp[0] > 10:
# abort()
#
# return steps_taken
def test_reassign_start_stop_step():
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment