commit e22017866c72c9b40ff2b344e63531b08a28045e
Author: Tanya Lattner <tonic@nondot.org>
Date: Tue Mar 30 23:03:45 2010 +0000
Merge 98095 from mainline. Fix for PR5893.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_27@99958 91177308-0d34-0410-b5e6-96231b3b80d8
commit c31826dd21149ef0099bd6351bbab473e52985be
Author: Tanya Lattner <tonic@nondot.org>
Date: Tue Mar 30 23:03:09 2010 +0000
Merge 98074 from mainline. Fix for PR5893.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_27@99956 91177308-0d34-0410-b5e6-96231b3b80d8
commit 719b038134bae6170947fbc68b52519ed6667fc6
Author: Tanya Lattner <tonic@nondot.org>
Date: Tue Mar 30 23:01:26 2010 +0000
Merge 99620 from mainline.
Do not sibcall if stack needs to be dynamically aligned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_27@99955 91177308-0d34-0410-b5e6-96231b3b80d8
commit 15bea010408543e85c1b2434905b72e5f14ffda5
Author: Tanya Lattner <tonic@nondot.org>
Date: Tue Mar 30 18:36:57 2010 +0000
Merge 99762 from mainline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_27@99908 91177308-0d34-0410-b5e6-96231b3b80d8
commit 17fa49b13862afbf4bc8a89f8e5d0246cde70b6c
Author: Tanya Lattner <tonic@nondot.org>
Date: Tue Mar 30 18:35:26 2010 +0000
Merge 99043 from mainline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_27@99907 91177308-0d34-0410-b5e6-96231b3b80d8
commit bf8b733ad5d4587dee92a34c7ae2e8ce74aeee17
Author: Tanya Lattner <tonic@nondot.org>
Date: Tue Mar 30 18:33:25 2010 +0000
Merge 98701 from mainline.
Fix death tests in -Assert builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_27@99906 91177308-0d34-0410-b5e6-96231b3b80d8
... | ... |
@@ -80,7 +80,7 @@ unsigned ARMBaseRegisterInfo::getRegisterNumbering(unsigned RegEnum, |
80 | 80 |
case D23: return 23; |
81 | 81 |
case D24: return 24; |
82 | 82 |
case D25: return 25; |
83 |
- case D26: return 27; |
|
83 |
+ case D26: return 26; |
|
84 | 84 |
case D27: return 27; |
85 | 85 |
case D28: return 28; |
86 | 86 |
case D29: return 29; |
... | ... |
@@ -2307,6 +2307,7 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee, |
2307 | 2307 |
return false; |
2308 | 2308 |
|
2309 | 2309 |
// If -tailcallopt is specified, make fastcc functions tail-callable. |
2310 |
+ const MachineFunction &MF = DAG.getMachineFunction(); |
|
2310 | 2311 |
const Function *CallerF = DAG.getMachineFunction().getFunction(); |
2311 | 2312 |
if (GuaranteedTailCallOpt) { |
2312 | 2313 |
if (IsTailCallConvention(CalleeCC) && |
... | ... |
@@ -2318,6 +2319,11 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee, |
2318 | 2318 |
// Look for obvious safe cases to perform tail call optimization that does not |
2319 | 2319 |
// requite ABI changes. This is what gcc calls sibcall. |
2320 | 2320 |
|
2321 |
+ // Can't do sibcall if stack needs to be dynamically re-aligned. PEI needs to |
|
2322 |
+ // emit a special epilogue. |
|
2323 |
+ if (RegInfo->needsStackRealignment(MF)) |
|
2324 |
+ return false; |
|
2325 |
+ |
|
2321 | 2326 |
// Do not sibcall optimize vararg calls for now. |
2322 | 2327 |
if (isVarArg) |
2323 | 2328 |
return false; |
... | ... |
@@ -216,3 +216,16 @@ entry: |
216 | 216 |
} |
217 | 217 |
|
218 | 218 |
declare fastcc %struct.ns* @foo7(%struct.cp* byval align 4, i8 signext) nounwind ssp |
219 |
+ |
|
220 |
+ |
|
221 |
+ |
|
222 |
+define void @t19() alignstack(32) nounwind { |
|
223 |
+entry: |
|
224 |
+; CHECK: t19: |
|
225 |
+; CHECK: andl $-32 |
|
226 |
+; CHECK: call {{_?}}foo |
|
227 |
+ tail call void @foo() nounwind |
|
228 |
+ ret void |
|
229 |
+} |
|
230 |
+ |
|
231 |
+declare void @foo() |
... | ... |
@@ -374,6 +374,7 @@ TEST(APFloatTest, makeNaN) { |
374 | 374 |
} |
375 | 375 |
|
376 | 376 |
#ifdef GTEST_HAS_DEATH_TEST |
377 |
+#ifndef NDEBUG |
|
377 | 378 |
TEST(APFloatTest, SemanticsDeath) { |
378 | 379 |
EXPECT_DEATH(APFloat(APFloat::IEEEsingle, 0.0f).convertToDouble(), "Float semantics are not IEEEdouble"); |
379 | 380 |
EXPECT_DEATH(APFloat(APFloat::IEEEdouble, 0.0 ).convertToFloat(), "Float semantics are not IEEEsingle"); |
... | ... |
@@ -573,5 +574,6 @@ TEST(APFloatTest, StringHexadecimalExponentDeath) { |
573 | 573 |
EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x1.1p-"), "Exponent has no digits"); |
574 | 574 |
} |
575 | 575 |
#endif |
576 |
+#endif |
|
576 | 577 |
|
577 | 578 |
} |
... | ... |
@@ -328,6 +328,7 @@ TEST(APIntTest, Log2) { |
328 | 328 |
} |
329 | 329 |
|
330 | 330 |
#ifdef GTEST_HAS_DEATH_TEST |
331 |
+#ifndef NDEBUG |
|
331 | 332 |
TEST(APIntTest, StringDeath) { |
332 | 333 |
EXPECT_DEATH(APInt(0, "", 0), "Bitwidth too small"); |
333 | 334 |
EXPECT_DEATH(APInt(32, "", 0), "Invalid string length"); |
... | ... |
@@ -340,5 +341,6 @@ TEST(APIntTest, StringDeath) { |
340 | 340 |
EXPECT_DEATH(APInt(32, "1L", 10), "Invalid character in digit string"); |
341 | 341 |
} |
342 | 342 |
#endif |
343 |
+#endif |
|
343 | 344 |
|
344 | 345 |
} |
... | ... |
@@ -14,18 +14,20 @@ |
14 | 14 |
# Set up variables for building a unit test. |
15 | 15 |
ifdef TESTNAME |
16 | 16 |
|
17 |
-CPP.Flags += -DGTEST_HAS_RTTI=0 |
|
18 |
-# gcc's TR1 <tuple> header depends on RTTI, so force googletest to use |
|
19 |
-# its own tuple implementation. When we import googletest >=1.4.0, we |
|
20 |
-# can drop this line. |
|
21 |
-CPP.Flags += -DGTEST_HAS_TR1_TUPLE=0 |
|
22 |
- |
|
23 | 17 |
include $(LEVEL)/Makefile.common |
24 | 18 |
|
25 | 19 |
LLVMUnitTestExe = $(BuildMode)/$(TESTNAME)Tests$(EXEEXT) |
26 | 20 |
|
27 |
-CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include/ |
|
28 |
-CPP.Flags += $(NO_VARIADIC_MACROS) |
|
21 |
+# Note that these flags are duplicated when building GoogleTest itself in |
|
22 |
+# utils/unittest/googletest/Makefile; ensure that any changes are made to both. |
|
23 |
+CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include |
|
24 |
+CPP.Flags += $(NO_MISSING_FIELD_INITIALIZERS) $(NO_VARIADIC_MACROS) |
|
25 |
+CPP.Flags += -DGTEST_HAS_RTTI=0 |
|
26 |
+# libstdc++'s TR1 <tuple> header depends on RTTI and uses C++'0x features not |
|
27 |
+# supported by Clang, so force googletest to use its own tuple implementation. |
|
28 |
+# When we import googletest >=1.4.0, we can drop this line. |
|
29 |
+CPP.Flags += -DGTEST_HAS_TR1_TUPLE=0 |
|
30 |
+ |
|
29 | 31 |
TESTLIBS = -lGoogleTest -lUnitTestMain |
30 | 32 |
|
31 | 33 |
ifeq ($(ENABLE_SHARED), 1) |
... | ... |
@@ -15,6 +15,7 @@ using namespace llvm; |
15 | 15 |
namespace { |
16 | 16 |
|
17 | 17 |
#ifdef GTEST_HAS_DEATH_TEST |
18 |
+#ifndef NDEBUG |
|
18 | 19 |
TEST(LeakDetector, Death1) { |
19 | 20 |
LeakDetector::addGarbageObject((void*) 1); |
20 | 21 |
LeakDetector::addGarbageObject((void*) 2); |
... | ... |
@@ -25,5 +26,6 @@ TEST(LeakDetector, Death1) { |
25 | 25 |
"Cache != o && \"Object already in set!\""); |
26 | 26 |
} |
27 | 27 |
#endif |
28 |
+#endif |
|
28 | 29 |
|
29 | 30 |
} |
... | ... |
@@ -14,7 +14,13 @@ include $(LEVEL)/Makefile.config |
14 | 14 |
LIBRARYNAME = UnitTestMain |
15 | 15 |
BUILD_ARCHIVE = 1 |
16 | 16 |
REQUIRES_RTTI = 1 |
17 |
+ |
|
17 | 18 |
CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include |
18 | 19 |
CPP.Flags += $(NO_MISSING_FIELD_INITIALIZERS) $(NO_VARIADIC_MACROS) |
20 |
+CPP.Flags += -DGTEST_HAS_RTTI=0 |
|
21 |
+# libstdc++'s TR1 <tuple> header depends on RTTI and uses C++'0x features not |
|
22 |
+# supported by Clang, so force googletest to use its own tuple implementation. |
|
23 |
+# When we import googletest >=1.4.0, we can drop this line. |
|
24 |
+CPP.Flags += -DGTEST_HAS_TR1_TUPLE=0 |
|
19 | 25 |
|
20 | 26 |
include $(LEVEL)/Makefile.common |
... | ... |
@@ -14,8 +14,18 @@ include $(LEVEL)/Makefile.config |
14 | 14 |
LIBRARYNAME = GoogleTest |
15 | 15 |
BUILD_ARCHIVE = 1 |
16 | 16 |
REQUIRES_RTTI = 1 |
17 |
+ |
|
18 |
+# Note that these flags are duplicated when building individual tests in |
|
19 |
+# unittests/Makefile.unittest and ../UnitTestMain/Makefile; ensure that any |
|
20 |
+# changes are made to both. |
|
17 | 21 |
CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include |
18 | 22 |
CPP.Flags += $(NO_MISSING_FIELD_INITIALIZERS) $(NO_VARIADIC_MACROS) |
23 |
+CPP.Flags += -DGTEST_HAS_RTTI=0 |
|
24 |
+# libstdc++'s TR1 <tuple> header depends on RTTI and uses C++'0x features not |
|
25 |
+# supported by Clang, so force googletest to use its own tuple implementation. |
|
26 |
+# When we import googletest >=1.4.0, we can drop this line. |
|
27 |
+CPP.Flags += -DGTEST_HAS_TR1_TUPLE=0 |
|
28 |
+ |
|
19 | 29 |
|
20 | 30 |
ifeq ($(HOST_OS),MingW) |
21 | 31 |
CPP.Flags += -DGTEST_OS_WINDOWS=1 |