Skip to content

Commit

Permalink
add test for 172
Browse files Browse the repository at this point in the history
  • Loading branch information
YashasSamaga committed Jan 12, 2018
1 parent 57ef615 commit 5f7691b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/compiler/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ set_tests_properties(unused_symbol_line_gh_252 PROPERTIES PASS_REGULAR_EXPRESSIO
.*\\.pwn\\(1\\) : warning 203: symbol is never used: \\\"x\\\"
")

add_compiler_test(meaningless_class_specifiers_gh_172 ${CMAKE_CURRENT_SOURCE_DIR}/meaningless_class_specifiers_gh_172.pwn)
set_tests_properties(meaningless_class_specifiers_gh_172 PROPERTIES PASS_REGULAR_EXPRESSION "\
.*\\.pwn\\(1\\) : warning 238: meaningless combination of class specifiers (const reference)\
.*\\.pwn\\(2\\) : warning 238: meaningless combination of class specifiers (const variable arguments)\
")

# Crashers
#
# These tests simply check that the compiler doesn't crash.
Expand Down
20 changes: 20 additions & 0 deletions source/compiler/tests/meaningless_class_specifiers_gh_172.pwn
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
f1(const &v) { }
f2(const ...) { }
f3(const v) {
#pragma unused v
}
f4(...) { }
f5(v) {
#pragma unused v
}
f6(&v) { }

main() {
new a;
f1(a);
f2(a);
f3(a);
f4(a);
f5(a);
f6(a);
}

0 comments on commit 5f7691b

Please sign in to comment.