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)

llvm-svn: 253114
This commit is contained in:
David Blaikie 2015-11-14 01:10:38 +00:00
parent 54c22c2245
commit 6267684a18
5 changed files with 16 additions and 146 deletions

View 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{{.*}} }

View 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 }

View File

@ -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{{.*}} }

View File

@ -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{{.*}} }

View 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{{.*}} }