Repository navigation
[Clang] [Tests] Add more tests for #210802 - #217735
Merged
Merged
Conversation
|
@llvm/pr-subscribers-clang Author: Ambrose Leeb (Sirraide) ChangesShafik requested more tests for #210802. Full diff: https://github.com/llvm/llvm-project/pull/217735.diff 1 Files Affected:
diff --git a/clang/test/Preprocessor/pragma_set_pp_state.cpp b/clang/test/Preprocessor/pragma_set_pp_state.cpp
index 763f23ce5868f..5e3f9179604a7 100644
--- a/clang/test/Preprocessor/pragma_set_pp_state.cpp
+++ b/clang/test/Preprocessor/pragma_set_pp_state.cpp
@@ -9,9 +9,24 @@
#pragma clang __set_pp_state __GLIBCXX__ foo // expected-error {{expected integer after '#pragma clang __set_pp_state __GLIBCXX__'}}
#pragma clang __set_pp_state __GLIBCXX__ 100000000000000000000000000000 // expected-error {{expected integer after '#pragma clang __set_pp_state __GLIBCXX__'}}
#pragma clang __set_pp_state __GLIBCXX__ 42.0 // expected-error {{expected integer after '#pragma clang __set_pp_state __GLIBCXX__'}}
+#pragma clang __set_pp_state __GLIBCXX__ 42.0f // expected-error {{expected integer after '#pragma clang __set_pp_state __GLIBCXX__'}}
+#pragma clang __set_pp_state __GLIBCXX__ true // expected-error {{expected integer after '#pragma clang __set_pp_state __GLIBCXX__'}}
+#pragma clang __set_pp_state __GLIBCXX__ false // expected-error {{expected integer after '#pragma clang __set_pp_state __GLIBCXX__'}}
+#pragma clang __set_pp_state __GLIBCXX__ nullptr // expected-error {{expected integer after '#pragma clang __set_pp_state __GLIBCXX__'}}
+#pragma clang __set_pp_state __GLIBCXX__ 'a' // expected-error {{expected integer after '#pragma clang __set_pp_state __GLIBCXX__'}}
+#pragma clang __set_pp_state __GLIBCXX__ "asdfasdf" // expected-error {{expected integer after '#pragma clang __set_pp_state __GLIBCXX__'}}
+#pragma clang __set_pp_state __GLIBCXX__ u'a' // expected-error {{expected integer after '#pragma clang __set_pp_state __GLIBCXX__'}}
+#pragma clang __set_pp_state __GLIBCXX__ u"asdfasdf" // expected-error {{expected integer after '#pragma clang __set_pp_state __GLIBCXX__'}}
+#pragma clang __set_pp_state __GLIBCXX__ 1234_asdf // expected-error {{expected integer after '#pragma clang __set_pp_state __GLIBCXX__'}}
#pragma clang __set_pp_state __GLIBCXX__ 42L
#pragma clang __set_pp_state __GLIBCXX__ 42
+#pragma clang __set_pp_state __GLIBCXX__ 0x42
+#pragma clang __set_pp_state __GLIBCXX__ 042
+#pragma clang __set_pp_state __GLIBCXX__ 0b10100
+
+#define TWENTY 20
+#pragma clang __set_pp_state __GLIBCXX__ TWENTY
// Check that we treat the identifier after '__set_pp_state' literally.
#define MACRO __GLIBCXX__
|
Fznamznon
approved these changes
Aug 21, 2026
Fznamznon
left a comment
Contributor
There was a problem hiding this comment.
I'm not Shafik, but LGTM just in case
cor3ntin
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shafik requested more tests for #210802.