]> granicus.if.org Git - clang/commitdiff
Make some tests LLVM-optimization agnostic and remove some others that were beyond...
authorDavid Blaikie <dblaikie@gmail.com>
Sat, 14 Nov 2015 01:10:38 +0000 (01:10 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sat, 14 Nov 2015 01:10:38 +0000 (01:10 +0000)
Several of these tests (the two deleted, and the one removal edit) were
relying on the optimizer to collapse things to test some frontend
feature. The tests were really old and features seemed amply covered by
other parts of the test suite, so I just removed them.

If anyone thinks they're valuable enough to keep/fix, we can play around
with that, for sure.

(inspired by r252872)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253114 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/attr-minsize.cpp
test/CodeGen/function-attributes.c
test/CodeGenCXX/default-destructor-synthesis.cpp [deleted file]
test/CodeGenCXX/member-initializers.cpp [deleted file]
test/CodeGenCXX/pointers-to-data-members.cpp

index 65e18532b66cded6befcc7d68a1c888996b0f49b..1e5c634dbdfc70fc676f833c7603bac6e0bd0b87 100644 (file)
@@ -1,9 +1,9 @@
-// RUN: %clang_cc1 -Oz -emit-llvm %s -o - | FileCheck %s -check-prefix=Oz
-// RUN: %clang_cc1     -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
-// RUN: %clang_cc1 -O1 -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
-// RUN: %clang_cc1 -O2 -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
-// RUN: %clang_cc1 -O3 -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
-// RUN: %clang_cc1 -Os -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
+// RUN: %clang_cc1 -Oz -disable-llvm-optzns -emit-llvm %s -o - | FileCheck %s -check-prefix=Oz
+// RUN: %clang_cc1     -disable-llvm-optzns -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
+// RUN: %clang_cc1 -O1 -disable-llvm-optzns -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
+// RUN: %clang_cc1 -O2 -disable-llvm-optzns -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
+// RUN: %clang_cc1 -O3 -disable-llvm-optzns -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
+// RUN: %clang_cc1 -Os -disable-llvm-optzns -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
 // Check that we set the minsize attribute on each function
 // when Oz optimization level is set.
 
@@ -76,4 +76,4 @@ void test5<float>(float arg);
 
 // Oz: attributes [[MINSIZE]] = { minsize{{.*}} }
 
-// OTHER: attributes [[MS]] = { minsize {{(norecurse )?}}nounwind{{.*}} }
+// OTHER: attributes [[MS]] = { minsize nounwind{{.*}} }
index 3590dffaefe67149ee0b69a223df49dfbbe85079..8f682a715d73bdef1578911bde85e85a1080e21d 100644 (file)
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -Os -o - %s | FileCheck %s
-// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -Os -std=c99 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -disable-llvm-optzns -Os -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -disable-llvm-optzns -Os -std=c99 -o - %s | FileCheck %s
 // CHECK: define signext i8 @f0(i32 %x) [[NUW:#[0-9]+]]
 // CHECK: define zeroext i8 @f1(i32 %x) [[NUW]]
 // CHECK: define void @f2(i8 signext %x) [[NUW]]
@@ -56,31 +56,11 @@ int f12(int arg) {
   return arg ? 0 : f10_t();
 }
 
-// CHECK: define void @f13() [[NUW]]
+// CHECK: define void @f13() [[NUW_OS_RN:#[0-9]+]]
 void f13(void) __attribute__((pure)) __attribute__((const));
 void f13(void){}
 
 
-// Ensure that these get inlined: rdar://6853279
-// CHECK-LABEL: define void @f14
-// CHECK-NOT: @ai_
-// CHECK: call void @f14_end
-static __inline__ __attribute__((always_inline))
-int ai_1() {  return 4; }
-
-static __inline__ __attribute__((always_inline))
-struct {
-  int a, b, c, d, e;
-} ai_2() { while (1) {} }
-
-void f14(int a) {
-  extern void f14_end(void);
-  if (a)
-    ai_2();
-  ai_1();
-  f14_end();
-}
-
 // <rdar://problem/7102668> [irgen] clang isn't setting the optsize bit on functions
 // CHECK-LABEL: define void @f15
 // CHECK: [[NUW]]
@@ -128,10 +108,11 @@ void f20(void) {
   _setjmp(0);
 }
 
-// CHECK: attributes [[NUW]] = { norecurse nounwind optsize readnone{{.*}} }
-// CHECK: attributes [[AI]] = { alwaysinline norecurse nounwind optsize readnone{{.*}} }
-// CHECK: attributes [[ALIGN]] = { norecurse nounwind optsize readnone alignstack=16{{.*}} }
+// CHECK: attributes [[NUW]] = { nounwind optsize{{.*}} }
+// CHECK: attributes [[AI]] = { alwaysinline nounwind optsize{{.*}} }
+// CHECK: attributes [[NUW_OS_RN]] = { nounwind optsize readnone{{.*}} }
+// CHECK: attributes [[ALIGN]] = { nounwind optsize alignstack=16{{.*}} }
 // CHECK: attributes [[RT]] = { nounwind optsize returns_twice{{.*}} }
-// CHECK: attributes [[NR]] = { noreturn nounwind optsize }
+// CHECK: attributes [[NR]] = { noreturn optsize }
 // CHECK: attributes [[NUW_RN]] = { nounwind optsize readnone }
-// CHECK: attributes [[RT_CALL]] = { nounwind optsize returns_twice }
+// CHECK: attributes [[RT_CALL]] = { optsize returns_twice }
diff --git a/test/CodeGenCXX/default-destructor-synthesis.cpp b/test/CodeGenCXX/default-destructor-synthesis.cpp
deleted file mode 100644 (file)
index 8daf383..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -O2 -o - | FileCheck %s
-static int count = 0;
-
-struct S {
-  S() { count++; }
-  ~S() { count--; }
-};
-
-struct P {
-  P() { count++; }
-  ~P() { count--; }
-};
-
-struct Q {
-  Q() { count++; }
-  ~Q() { count--; }
-};
-
-struct M : Q, P {
-  S s;
-  Q q;
-  P p;
-  P p_arr[3];
-  Q q_arr[2][3];
-};
-  
-// CHECK: define i32 @_Z1fv() [[NUW:#[0-9]+]]
-int f() {
-  {
-    count = 1;
-    M a;
-  }
-
-  // CHECK: ret i32 1
-  return count;
-}
-
-// CHECK: attributes [[NUW]] = { norecurse nounwind{{.*}} }
diff --git a/test/CodeGenCXX/member-initializers.cpp b/test/CodeGenCXX/member-initializers.cpp
deleted file mode 100644 (file)
index 5bbf00b..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin10 -O3 | FileCheck %s
-
-struct A {
-  virtual int f() { return 1; }
-};
-
-struct B : A {
-  B() : i(f()) { }
-  
-  virtual int f() { return 2; }
-  
-  int i;
-};
-
-// CHECK-LABEL: define i32 @_Z1fv() #0
-int f() {
-  B b;
-  
-  // CHECK: ret i32 2
-  return b.i;
-}
-
-// Test that we don't try to fold the default value of j when initializing i.
-// CHECK: define i32 @_Z9test_foldv() [[NUW_RN:#[0-9]+]]
-int test_fold() {
-  struct A {
-    A(const int j = 1) : i(j) { } 
-    int i;
-  };
-
-  // CHECK: ret i32 2
-  return A(2).i;
-}
-
-// CHECK: attributes [[NUW_RN]] = { norecurse nounwind readnone{{.*}} }
index 240d74084ac9f509ad59ca1c6699923e5eae1ad4..fd1b9b8215f4957fff9b2a3bfb68c77a1260b150 100644 (file)
@@ -1,8 +1,6 @@
 // RUN: %clang_cc1 %s -emit-llvm -o %t.ll -triple=x86_64-apple-darwin10
 // RUN: FileCheck %s < %t.ll
 // RUN: FileCheck -check-prefix=CHECK-GLOBAL %s < %t.ll
-// RUN: %clang_cc1 %s -emit-llvm -o %t-opt.ll -triple=x86_64-apple-darwin10 -O3
-// RUN: FileCheck --check-prefix=CHECK-O3 %s < %t-opt.ll
 
 struct A { int a; int b; };
 struct B { int b; };
@@ -131,40 +129,6 @@ A::A() : a() {}
 
 }
 
-namespace PR7139 {
-
-struct pair {
-  int first;
-  int second;
-};
-
-typedef int pair::*ptr_to_member_type;
-
-struct ptr_to_member_struct { 
-  ptr_to_member_type data;
-  int i;
-};
-
-struct A {
-  ptr_to_member_struct a;
-
-  A() : a() {}
-};
-
-// CHECK-O3: define zeroext i1 @_ZN6PR71395checkEv() [[NUW:#[0-9]+]]
-bool check() {
-  // CHECK-O3: ret i1 true
-  return A().a.data == 0;
-}
-
-// CHECK-O3: define zeroext i1 @_ZN6PR71396check2Ev() [[NUW]]
-bool check2() {
-  // CHECK-O3: ret i1 true
-  return ptr_to_member_type() == 0;
-}
-
-}
-
 namespace VirtualBases {
 
 struct A {
@@ -294,5 +258,3 @@ union U {
 U u;
 // CHECK-GLOBAL: @_ZN11IndirectPDM1uE = global %"union.IndirectPDM::U" { %union.anon { i64 -1 } }, align 8
 }
-
-// CHECK-O3: attributes [[NUW]] = { norecurse nounwind readnone{{.*}} }