r253114 - Make some tests LLVM-optimization agnostic and remove some others that were beyond value/repair
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 13 17:10:38 PST 2015
Author: dblaikie
Date: Fri Nov 13 19:10:38 2015
New Revision: 253114
URL: http://llvm.org/viewvc/llvm-project?rev=253114&view=rev
Log:
Make some tests LLVM-optimization agnostic and remove some others that were beyond value/repair
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)
Removed:
cfe/trunk/test/CodeGenCXX/default-destructor-synthesis.cpp
cfe/trunk/test/CodeGenCXX/member-initializers.cpp
Modified:
cfe/trunk/test/CodeGen/attr-minsize.cpp
cfe/trunk/test/CodeGen/function-attributes.c
cfe/trunk/test/CodeGenCXX/pointers-to-data-members.cpp
Modified: cfe/trunk/test/CodeGen/attr-minsize.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/attr-minsize.cpp?rev=253114&r1=253113&r2=253114&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/attr-minsize.cpp (original)
+++ cfe/trunk/test/CodeGen/attr-minsize.cpp Fri Nov 13 19:10:38 2015
@@ -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{{.*}} }
Modified: cfe/trunk/test/CodeGen/function-attributes.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/function-attributes.c?rev=253114&r1=253113&r2=253114&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/function-attributes.c (original)
+++ cfe/trunk/test/CodeGen/function-attributes.c Fri Nov 13 19:10:38 2015
@@ -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 }
Removed: cfe/trunk/test/CodeGenCXX/default-destructor-synthesis.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/default-destructor-synthesis.cpp?rev=253113&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/default-destructor-synthesis.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/default-destructor-synthesis.cpp (removed)
@@ -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{{.*}} }
Removed: cfe/trunk/test/CodeGenCXX/member-initializers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/member-initializers.cpp?rev=253113&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/member-initializers.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/member-initializers.cpp (removed)
@@ -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{{.*}} }
Modified: cfe/trunk/test/CodeGenCXX/pointers-to-data-members.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/pointers-to-data-members.cpp?rev=253114&r1=253113&r2=253114&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/pointers-to-data-members.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/pointers-to-data-members.cpp Fri Nov 13 19:10:38 2015
@@ -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{{.*}} }
More information about the cfe-commits
mailing list