-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Make module std; and module std.compat; work with Clang
#5982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -15,9 +15,20 @@ () | |||||
| my $stdIxx = "$stlModulesDir\\std.ixx"; | ||||||
| my $stdCompatIxx = "$stlModulesDir\\std.compat.ixx"; | ||||||
|
|
||||||
| # Dependency order is important here: | ||||||
| my @inputPaths = ($stdIxx, $stdCompatIxx, "test.cpp", "test2.cpp", "test3.cpp", "test4.cpp", "classic.cpp"); | ||||||
| my @moduleUnits = ($stdIxx, $stdCompatIxx); | ||||||
| my @traditionalUnits = ("test.cpp", "test2.cpp", "test3.cpp", "test4.cpp", "classic.cpp"); | ||||||
|
|
||||||
| Run::ExecuteCL(join(" ", @inputPaths, "/Fe$cwd.exe")); | ||||||
| if ($ENV{PM_COMPILER} =~ m/clang/) { | ||||||
|
||||||
| if ($ENV{PM_COMPILER} =~ m/clang/) { | |
| if ($ENV{PM_COMPILER} =~ m/clang/i) { |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,10 +15,17 @@ def getBuildSteps(self, test, litConfig, shared): | |||||||||||||
| sourceDir = os.path.dirname(testCpp) | ||||||||||||||
| userIxx = os.path.join(sourceDir, 'user.ixx') | ||||||||||||||
|
|
||||||||||||||
| # Dependency order is important here: | ||||||||||||||
| inputPaths = [userIxx, testCpp] | ||||||||||||||
| if 'clang' in test.cxx: | ||||||||||||||
| cmd = [test.cxx, '-x', 'c++-module', userIxx, '--precompile', *test.flags, *test.compileFlags] | ||||||||||||||
| yield TestStep(cmd, shared.execDir, shared.env, False) | ||||||||||||||
|
Comment on lines
+18
to
+20
|
||||||||||||||
| if 'clang' in test.cxx: | |
| cmd = [test.cxx, '-x', 'c++-module', userIxx, '--precompile', *test.flags, *test.compileFlags] | |
| yield TestStep(cmd, shared.execDir, shared.env, False) | |
| if 'clang' in test.config.available_features: | |
| cmd = [test.cxx, '-x', 'c++-module', userIxx, '--precompile', *test.flags, *test.compileFlags] | |
| yield TestStep(cmd, shared.execDir, shared.env, False) |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -10,9 +10,14 @@ () | |||||
| { | ||||||
| my $cwd = Run::GetCWDName(); | ||||||
|
|
||||||
| # Dependency order is important here: | ||||||
| my @inputPaths = ("user.ixx", "test.cpp"); | ||||||
| if ($ENV{PM_COMPILER} =~ m/clang/) { | ||||||
|
||||||
| if ($ENV{PM_COMPILER} =~ m/clang/) { | |
| if ($ENV{PM_COMPILER} =~ m/clang/i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Clang detection is case-sensitive (
'clang' in test.cxx). Elsewhere in the lit harness the compiler is identified case-insensitively (seetests/utils/stl/test/tests.pyusingcasefold()), so this can fail to recognize Clang for differently-cased paths and skip the--precompilesteps. Please make the check case-insensitive (preferably usingos.path.basename(test.cxx).casefold()) or key off the existingclangfeature.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.