[llvm-commits] [llvm] r66564 - /llvm/branches/Apple/Dib/test/FrontendC/2009-03-09-WeakDeclarations-1.c

Bill Wendling isanbard at gmail.com
Tue Mar 10 11:54:37 PDT 2009


Author: void
Date: Tue Mar 10 13:54:36 2009
New Revision: 66564

URL: http://llvm.org/viewvc/llvm-project?rev=66564&view=rev
Log:
--- Merging (from foreign repository) r66514 into '.':
A    test/FrontendC/2009-03-09-WeakDeclarations-1.c

Check for warnings about inappropriate weak_imports.
Darwin-specific; marked XFAIL for others.

Added:
    llvm/branches/Apple/Dib/test/FrontendC/2009-03-09-WeakDeclarations-1.c

Added: llvm/branches/Apple/Dib/test/FrontendC/2009-03-09-WeakDeclarations-1.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/FrontendC/2009-03-09-WeakDeclarations-1.c?rev=66564&view=auto

==============================================================================
--- llvm/branches/Apple/Dib/test/FrontendC/2009-03-09-WeakDeclarations-1.c (added)
+++ llvm/branches/Apple/Dib/test/FrontendC/2009-03-09-WeakDeclarations-1.c Tue Mar 10 13:54:36 2009
@@ -0,0 +1,22 @@
+// RUN: $llvmgcc $test -c -o /dev/null |& \
+// RUN: egrep {(14|15|22): warning:} |	\
+// RUN: wc -l | grep --quiet 3
+// XTARGET: darwin
+// XFAIL: *
+// END.
+// Insist upon warnings for inappropriate weak attributes.
+// Note the line numbers (14|15|22) embedded in the check.
+
+// O.K.
+extern int ext_weak_import __attribute__ ((__weak_import__));
+
+// These are inappropriate, and should generate warnings:
+int decl_weak_import __attribute__ ((__weak_import__));
+int decl_initialized_weak_import __attribute__ ((__weak_import__)) = 13;
+
+// O.K.
+extern int ext_f(void) __attribute__ ((__weak_import__));
+
+// These are inappropriate, and should generate warnings:
+int def_f(void) __attribute__ ((__weak_import__));
+int __attribute__ ((__weak_import__)) decl_f(void) {return 0;};





More information about the llvm-commits mailing list