#!/usr/bin/env python

from __future__ import print_function
import os
import sys


myfile = os.path.basename(__file__)

perftest = ''
(base,suffix) = myfile.split('.')
if suffix != "compopts":
  perftest = base

do_llvm = True
if os.getenv('CHPL_LLVM', 'none') == 'none':
    do_llvm = False

basecompopts='--fast '

def f(options, configname):
  s = basecompopts + options
  if perftest != '':
    s += ' # ' + perftest + '-' + configname
  print(s)

# Include this argument to print out an error if a passed maximum count
# is not attained. Note that the perf testing only reports on counts
# where the maximum is not passed.
checkMaxAttained=' -scheckMaxAttained=true'

# C backend, no cache remote
f('--no-llvm --no-cache-remote ' + checkMaxAttained, 'c')

# C backend, cache remote
f('--no-llvm --cache-remote', 'c-cache')

if do_llvm:
  # LLVM backend, no cache remote
  #f('--llvm --no-cache-remote', 'llvm')
  # LLVM backend, cache remote
  #f('--llvm --cache-remote', 'llvm-cache')
  # LLVM backend, llvm wide opts, no cache remote
  f('--llvm --llvm-wide-opt --no-cache-remote', 'llvm-wide-opt')
  # LLVM backend, llvm wide opts, cache remote
  f('--llvm --llvm-wide-opt --cache-remote', 'llvm-wide-opt-cache')
