summaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/attr-used.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGen/attr-used.c')
-rw-r--r--clang/test/CodeGen/attr-used.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/CodeGen/attr-used.c b/clang/test/CodeGen/attr-used.c
new file mode 100644
index 0000000..bc92b94
--- /dev/null
+++ b/clang/test/CodeGen/attr-used.c
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -emit-llvm -o %t %s
+// RUN: grep '@llvm.used = .*@g0' %t
+// RUN: grep '@llvm.used = .*@f0' %t
+// RUN: grep '@llvm.used = .*@f1.l0' %t
+
+
+int g0 __attribute__((used));
+
+static void __attribute__((used)) f0(void) {
+}
+
+void f1() {
+ static int l0 __attribute__((used)) = 5225;
+}