Skip to content
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

2007-06-15-AnnotateAttribute.c does not show local variable annotations #10894

Closed
llvmbot opened this issue Jul 28, 2011 · 4 comments
Closed
Labels
bugzilla Issues migrated from bugzilla clang:codegen

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Jul 28, 2011

Bugzilla Link 10522
Version 2.9
OS Linux
Reporter LLVM Bugzilla Contributor

Extended Description

llvm/test/FrontendC/2007-06-15-AnnotateAttribute.c has a comment that reads:
// RUN: %llvmgcc -S %s -o - | grep llvm.global.annotations
// RUN: %llvmgcc -S %s -o - | grep llvm.var.annotation | count 3

When I run the following I get no output of any kind:
"clang -emit-llvm -S 2007-06-15-AnnotateAttribute.c -o - | grep llvm.var.annotation"

The following does seem to function correctly:
"clang -emit-llvm -S 2007-06-15-AnnotateAttribute.c -o - | grep llvm.global.annotation"

It outputs:
@​llvm.global.annotations = appending global [2 x { i8*, i8*, i8*, i32 }] [{ i8*, i8*, i8*, i32 } { i8* bitcast (i32* @​main.a to i8*), i8* getelementptr inbounds ([20 x i8]* @​main.a1, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8]* @.str, i32 0, i32 0), i32 20 }, { i8*, i8*, i8*, i32 } { i8* bitcast (i32* @​X to i8*), i8* getelementptr inbounds ([20 x i8]* @​X3, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8]* @.str4, i32 0, i32 0), i32 7 }], section "llvm.metadata"

I attached the output of
"clang -emit-llvm -S 2007-06-15-AnnotateAttribute.c"

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jul 28, 2011

Note that llvm-gcc does produce the local annotations.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jul 28, 2011

Output generated

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
arsenm added a commit that referenced this issue Aug 14, 2023
Issue #10894 seems to claim this wasn't working. The test does seem to
work as intended, except the CHECKs added in
3ac4299 aren't doing anything since
it wasn't really using FileCheck.
@llvmbot
Copy link
Collaborator Author

llvmbot commented Aug 14, 2023

@llvm/issue-subscribers-clang-codegen

@arsenm
Copy link
Contributor

arsenm commented Aug 14, 2023

I believe this is working correctly, I've switched the test to using FileCheck

@arsenm arsenm closed this as completed Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:codegen
Projects
None yet
Development

No branches or pull requests

2 participants