Report warning for non-boolean CLI argument passed multiple times

Only if its values are different, see the test
This commit is contained in:
Alexander Udalov
2017-04-06 16:15:28 +03:00
parent be54e4b93b
commit ff846e787f
17 changed files with 54 additions and 45 deletions
@@ -0,0 +1,16 @@
$TESTDATA_DIR$/simple.kt
-cp
$TESTDATA_DIR$
-cp
$TESTDATA_DIR$
-java-parameters
-java-parameters
-Xno-inline
-d
$TEMP_DIR$
-java-parameters
-Xno-inline
-module-name
aaa
-module-name
bbb
@@ -0,0 +1,2 @@
warning: argument -module-name is passed multiple times. Only the last value will be used: bbb
OK
@@ -1,4 +0,0 @@
$TESTDATA_DIR$/simple.kt
-Xcoroutines=enable
-Xcoroutines=warn
-Xcoroutines=error
@@ -1,2 +0,0 @@
error: the -Xcoroutines can only have one value
COMPILATION_ERROR
@@ -1,3 +1,5 @@
$TESTDATA_DIR$/simple.kt
-Xcoroutines=error
-Xcoroutines=enable
-Xcoroutines=enable
-d
$TEMP_DIR$
@@ -0,0 +1,2 @@
warning: argument -Xcoroutines is passed multiple times. Only the last value will be used: enable
OK
@@ -1,2 +0,0 @@
error: the -Xcoroutines can only have one value
COMPILATION_ERROR
@@ -1,3 +0,0 @@
$TESTDATA_DIR$/simple.kt
-Xcoroutines=warn
-Xcoroutines=enable
@@ -1,2 +0,0 @@
error: the -Xcoroutines can only have one value
COMPILATION_ERROR
@@ -1,3 +0,0 @@
$TESTDATA_DIR$/simple.kt
-Xcoroutines=warn
-Xcoroutines=error
@@ -1,2 +0,0 @@
error: the -Xcoroutines can only have one value
COMPILATION_ERROR