Skip to content

Add CHECK-LABEL to avoid source tree path sensitivity in test #112461

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

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

tex3d
Copy link
Contributor

@tex3d tex3d commented Oct 16, 2024

The test clang/test/CodeGen/2004-02-20-Builtins.c will erroneously fail if "builtin" is in the path to your source tree.

This change adds a CHECK-LABEL !llvm.ident after the CHECK-NOT to avoid searching into the metadata containing the path.

The test `clang/test/CodeGen/2004-02-20-Builtins.c` will erroneously fail if "builtin" is in the path to your source tree.

This change adds a `CHECK-LABEL !llvm.ident` after the `CHECK-NOT` to avoid searching into the metadata containing the path.
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Oct 16, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 16, 2024

@llvm/pr-subscribers-clang

Author: Tex Riddell (tex3d)

Changes

The test clang/test/CodeGen/2004-02-20-Builtins.c will erroneously fail if "builtin" is in the path to your source tree.

This change adds a CHECK-LABEL !llvm.ident after the CHECK-NOT to avoid searching into the metadata containing the path.


Full diff: https://github.com/llvm/llvm-project/pull/112461.diff

1 Files Affected:

  • (modified) clang/test/CodeGen/2004-02-20-Builtins.c (+3)
diff --git a/clang/test/CodeGen/2004-02-20-Builtins.c b/clang/test/CodeGen/2004-02-20-Builtins.c
index 13f970127d606a..4febe2fd30e1dd 100644
--- a/clang/test/CodeGen/2004-02-20-Builtins.c
+++ b/clang/test/CodeGen/2004-02-20-Builtins.c
@@ -3,6 +3,9 @@ double sqrt(double x);
 
 // CHECK-LABEL: @zsqrtxxx
 // CHECK-NOT: builtin
+// Don't search into metadata definitions.  !llvm.ident can contain the
+// substring "builtin" if it's in the source tree path.
+// CHECK-LABEL: !llvm.ident
 void zsqrtxxx(float num) {
    num = sqrt(num);
 }

Copy link
Contributor

@bogner bogner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also consider checking for ret void instead, as that's more flexible if someone were to add another test case later in the file. This seems fine too though.

@tex3d tex3d merged commit 6582785 into llvm:main Oct 31, 2024
10 checks passed
@tex3d tex3d deleted the fix-check-not-builtin branch October 31, 2024 16:04
smallp-o-p pushed a commit to smallp-o-p/llvm-project that referenced this pull request Nov 3, 2024
…12461)

The test `clang/test/CodeGen/2004-02-20-Builtins.c` will erroneously
fail if "builtin" is in the path to your source tree.

This change adds a `CHECK-LABEL !llvm.ident` after the `CHECK-NOT` to
avoid searching into the metadata containing the path.
NoumanAmir657 pushed a commit to NoumanAmir657/llvm-project that referenced this pull request Nov 4, 2024
…12461)

The test `clang/test/CodeGen/2004-02-20-Builtins.c` will erroneously
fail if "builtin" is in the path to your source tree.

This change adds a `CHECK-LABEL !llvm.ident` after the `CHECK-NOT` to
avoid searching into the metadata containing the path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants