[llvm-commits] [llvm-gcc-4.2] r54500 - in /llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple: const-cfstring-5.C empty-destructor-stmt-seq.C kext-stackprotect-1.C kext-stackprotect-2.C omit-destructor-call-scope.C omit-destructor-call.C thunks1.C thunks2.C thunks3.C thunks4.C visibility-2.C visibility-3.C weak-1.C
Bill Wendling
isanbard at gmail.com
Thu Aug 7 18:04:03 PDT 2008
Author: void
Date: Thu Aug 7 20:04:03 2008
New Revision: 54500
URL: http://llvm.org/viewvc/llvm-project?rev=54500&view=rev
Log:
Add non-blocks tests. Blocks tests will come after a blocks support update.
Added:
llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/const-cfstring-5.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/empty-destructor-stmt-seq.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-stackprotect-1.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-stackprotect-2.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/omit-destructor-call-scope.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/omit-destructor-call.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/thunks1.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/thunks2.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/thunks3.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/thunks4.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/visibility-2.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/visibility-3.C
llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/weak-1.C
Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/const-cfstring-5.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/const-cfstring-5.C?rev=54500&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/const-cfstring-5.C (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/const-cfstring-5.C Thu Aug 7 20:04:03 2008
@@ -0,0 +1,12 @@
+/* APPLE LOCAL file radar 6068877 */
+/* Test that utf16 characters in a cfstring literal is supported in c++, as well as
+ objc, objc++. */
+/* { dg-options "-Werror" } */
+/* { dg-do compile { target *-*-darwin* } } */
+
+#import <CoreFoundation/CFString.h>
+
+int main()
+{
+ CFSTR("hé hé hé");
+}
Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/empty-destructor-stmt-seq.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/empty-destructor-stmt-seq.C?rev=54500&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/empty-destructor-stmt-seq.C (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/empty-destructor-stmt-seq.C Thu Aug 7 20:04:03 2008
@@ -0,0 +1,25 @@
+/* APPLE LOCAL file 5559195 */
+// { dg-do run }
+
+// Verify that an empty statement list does not cause the destructor to be
+// marked as trivial.
+
+int N = 1;
+
+class A {
+public:
+ ~A () {
+ N = 0;
+ {}
+ }
+};
+
+class B : public A {
+};
+
+int
+main ()
+{
+ { B b; }
+ return N;
+}
Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-stackprotect-1.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/kext-stackprotect-1.C?rev=54500&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-stackprotect-1.C (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-stackprotect-1.C Thu Aug 7 20:04:03 2008
@@ -0,0 +1,11 @@
+/* APPLE LOCAL file stack-protector default 5095227 */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-fapple-kext -mmacosx-version-min=10.6" } */
+extern void f2(char *);
+void f1(void)
+{
+ char array[256];
+ f2(array);
+}
+/* { dg-final { scan-assembler-not "__stack_chk_guard" } } */
+/* { dg-final { scan-assembler-not "__stack_chk_fail" } } */
Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-stackprotect-2.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/kext-stackprotect-2.C?rev=54500&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-stackprotect-2.C (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-stackprotect-2.C Thu Aug 7 20:04:03 2008
@@ -0,0 +1,11 @@
+/* APPLE LOCAL file stack-protector default 5095227 */
+/* { dg-do compile { target i?86*-*-darwin* } } */
+/* { dg-options "-fapple-kext" } */
+extern void f2(char *);
+void f1(void)
+{
+ char array[256];
+ f2(array);
+}
+/* { dg-final { scan-assembler-not "__stack_chk_guard" } } */
+/* { dg-final { scan-assembler-not "__stack_chk_fail" } } */
Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/omit-destructor-call-scope.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/omit-destructor-call-scope.C?rev=54500&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/omit-destructor-call-scope.C (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/omit-destructor-call-scope.C Thu Aug 7 20:04:03 2008
@@ -0,0 +1,36 @@
+/* APPLE LOCAL file 5559195 */
+// { dg-do compile }
+// { dg-final { scan-assembler-not "(\tcall|\tbl)\[ \]*__ZN6ClassAD1Ev" } }
+// { dg-final { scan-assembler "(\tcall|\tbl)\[ \]*__ZN6ClassBD1Ev" } }
+
+// Verify that implicit calls to empty destructors are omitted and implicit
+// calls to non-empty destructors are not omitted when instances fall out of
+// scope.
+
+int n;
+
+class ClassA {
+public:
+ // Empty destructor. Should not be called when ClassA instance falls out
+ // of scope.
+ ~ClassA() {}
+};
+
+class ClassB {
+public:
+ // Non-empty destructor. Should be called when ClassB instance falls out
+ // of scope.
+ ~ClassB() {
+ n = 0;
+ }
+};
+
+int
+main() {
+ n = 1;
+ {
+ ClassA a; // Destructor not called.
+ ClassB b; // Destructor called.
+ }
+ return n;
+}
Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/omit-destructor-call.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/omit-destructor-call.C?rev=54500&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/omit-destructor-call.C (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/omit-destructor-call.C Thu Aug 7 20:04:03 2008
@@ -0,0 +1,19 @@
+/* APPLE LOCAL file 5559195 */
+// { dg-do compile }
+// { dg-final { scan-assembler-not "(\tcall|\tbl)\[ \]*__ZN6ClassAD2Ev" } }
+
+// Verify that implicit calls to empty destructors are omitted.
+
+class ClassA {
+public:
+ ~ClassA() {} // Empty destructor. Should not be called by B's destructor.
+};
+
+class ClassB : public ClassA {
+};
+
+int
+main() {
+ { ClassB b; } // Destructor called as b falls out of scope.
+ return 0;
+}
Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/thunks1.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/thunks1.C?rev=54500&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/thunks1.C (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/thunks1.C Thu Aug 7 20:04:03 2008
@@ -0,0 +1,31 @@
+/* APPLE LOCAL file 5920116 */
+/* Test proper generation of weak virtual function thunks. */
+/* { dg-do run } */
+
+int result = 101;
+
+struct Interface1
+{
+ int if1_var;
+ virtual void Interface1Func(void) = 0;
+};
+
+struct Interface2
+{
+ virtual void Interface2Func(void) = 0;
+};
+
+class Implementation : public Interface1, public Interface2
+{
+ void Interface1Func(void) { result -= 1; }
+ void Interface2Func(void) { result -= 100; }
+};
+
+int main (void)
+{
+ Implementation *o2 = new Implementation;
+ ((Interface1 *) o2)->Interface1Func();
+ ((Interface2 *) o2)->Interface2Func();
+ delete o2;
+ return result;
+}
Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/thunks2.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/thunks2.C?rev=54500&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/thunks2.C (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/thunks2.C Thu Aug 7 20:04:03 2008
@@ -0,0 +1,32 @@
+/* APPLE LOCAL file 5920116 */
+/* Test proper generation of weak virtual function thunks. */
+/* { dg-do run } */
+/* { dg-options "-mdynamic-no-pic" } */
+
+int result = 101;
+
+struct Interface1
+{
+ int if1_var;
+ virtual void Interface1Func(void) = 0;
+};
+
+struct Interface2
+{
+ virtual void Interface2Func(void) = 0;
+};
+
+class Implementation : public Interface1, public Interface2
+{
+ void Interface1Func(void) { result -= 1; }
+ void Interface2Func(void) { result -= 100; }
+};
+
+int main (void)
+{
+ Implementation *o2 = new Implementation;
+ ((Interface1 *) o2)->Interface1Func();
+ ((Interface2 *) o2)->Interface2Func();
+ delete o2;
+ return result;
+}
Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/thunks3.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/thunks3.C?rev=54500&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/thunks3.C (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/thunks3.C Thu Aug 7 20:04:03 2008
@@ -0,0 +1,41 @@
+/* APPLE LOCAL file 5920116 */
+/* Test proper generation of non-weak virtual function thunks. */
+/* { dg-do run } */
+
+int result = 101;
+
+struct Interface1
+{
+ int if1_var;
+ virtual void Interface1Func(void) = 0;
+};
+
+struct Interface2
+{
+ virtual void Interface2Func(void) = 0;
+};
+
+class Implementation : public Interface1, public Interface2
+{
+ void Interface1Func(void);
+ void Interface2Func(void);
+};
+
+void Implementation::Interface1Func(void)
+{
+ result -= 1;
+}
+
+void Implementation::Interface2Func(void)
+{
+ result -= 100;
+}
+
+int main (void)
+{
+ Implementation *o2 = new Implementation;
+ ((Interface1 *) o2)->Interface1Func();
+ ((Interface2 *) o2)->Interface2Func();
+ delete o2;
+ return result;
+}
Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/thunks4.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/thunks4.C?rev=54500&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/thunks4.C (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/thunks4.C Thu Aug 7 20:04:03 2008
@@ -0,0 +1,42 @@
+/* APPLE LOCAL file 5920116 */
+/* Test proper generation of non-weak virtual function thunks. */
+/* { dg-do run } */
+/* { dg-options "-mdynamic-no-pic" } */
+
+int result = 101;
+
+struct Interface1
+{
+ int if1_var;
+ virtual void Interface1Func(void) = 0;
+};
+
+struct Interface2
+{
+ virtual void Interface2Func(void) = 0;
+};
+
+class Implementation : public Interface1, public Interface2
+{
+ void Interface1Func(void);
+ void Interface2Func(void);
+};
+
+void Implementation::Interface1Func(void)
+{
+ result -= 1;
+}
+
+void Implementation::Interface2Func(void)
+{
+ result -= 100;
+}
+
+int main (void)
+{
+ Implementation *o2 = new Implementation;
+ ((Interface1 *) o2)->Interface1Func();
+ ((Interface2 *) o2)->Interface2Func();
+ delete o2;
+ return result;
+}
Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/visibility-2.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/visibility-2.C?rev=54500&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/visibility-2.C (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/visibility-2.C Thu Aug 7 20:04:03 2008
@@ -0,0 +1,30 @@
+/* APPLE LOCAL file constrain visibility for templates 5813435 */
+/* { dg-require-visibility "" } */
+/* { dg-options "-fvisibility=hidden" } */
+
+/* { dg-final { scan-hidden "__ZN1s6vectorI1AEC1Ev" } } */
+/* { dg-final { scan-hidden "__ZN1s3fooI1AEEvT_" } } */
+/* Radar 5813435 */
+
+namespace s __attribute__((visibility("default"))) {
+ template <class T>
+ class vector {
+ public:
+ vector() { }
+ };
+ template <class T>
+ void foo(T t) {
+ }
+}
+
+class A {
+public:
+ A() { }
+};
+
+s::vector<A> v;
+
+int main() {
+ A a;
+ s::foo(a);
+}
Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/visibility-3.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/visibility-3.C?rev=54500&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/visibility-3.C (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/visibility-3.C Thu Aug 7 20:04:03 2008
@@ -0,0 +1,15 @@
+/* APPLE LOCAL file ARM 6062215 */
+/* { dg-do compile { target arm*-*-darwin* } } */
+/* { dg-options "-fvisibility-inlines-hidden" } */
+/* { dg-final { scan-assembler "__ZN8my_class2fnEv\\\$lazy_ptr" } } */
+
+struct my_class {
+ inline void fn (void) {}
+};
+
+void foo (void)
+{
+ my_class mci;
+ mci.fn ();
+}
+
Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/weak-1.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/weak-1.C?rev=54500&view=auto
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/weak-1.C (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/weak-1.C Thu Aug 7 20:04:03 2008
@@ -0,0 +1,19 @@
+/* APPLE LOCAL file weak types 5954418 */
+/* { dg-do compile } */
+/* { dg-final { scan-assembler "weak_definition __ZTI1B" } } */
+/* { dg-final { scan-assembler "weak_definition __ZTI1A" } } */
+/* Radar 5954418 */
+
+#define WEAK __attribute__ ((weak))
+
+class WEAK A {
+ virtual void foo();
+};
+
+class B : public A {
+ virtual void foo();
+};
+
+void A::foo() { }
+
+void B::foo() { }
More information about the llvm-commits
mailing list