aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-31 19:07:59 +0000
committerChris Lattner <sabre@nondot.org>2005-08-31 19:07:59 +0000
commit4475ce41738cbdabc306ea870a33e400856a21fa (patch)
treef9e6cce66d9e524b2642ad55ddec413edee2cb83
parent23b2f111d16fbeb12d30e9043772db808cfbeade (diff)
Make this test not get constant folded away.
git-svn-id: https://llvm.org/svn/llvm-project/test-suite/trunk@23175 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--SingleSource/UnitTests/2003-05-31-LongShifts.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/SingleSource/UnitTests/2003-05-31-LongShifts.c b/SingleSource/UnitTests/2003-05-31-LongShifts.c
index c31a58ac..0c400dea 100644
--- a/SingleSource/UnitTests/2003-05-31-LongShifts.c
+++ b/SingleSource/UnitTests/2003-05-31-LongShifts.c
@@ -5,14 +5,21 @@ void Test(long long Val, int Amt) {
(unsigned long long)Val >> Amt, Val << Amt);
}
-int main() {
- Test(123, 4);
- Test(123, 34);
- Test(-4, 4);
- Test(-5, 34);
- Test(-6000000000LL, 4);
- Test(-6000000000LL, 34);
- Test( 6000000000LL, 4);
- Test( 6000000000LL, 34);
+volatile struct {
+ long long A; int V;
+} Vals[] = {
+ { 123, 4},
+ { 123, 34},
+ {-4, 4},
+ {-5, 34},
+ { -6000000000LL, 4},
+ { -6000000000LL, 34},
+ { 6000000000LL, 4},
+ { 6000000000LL, 34}
+};
+
+int main(int argc, char**argv) {
+ for (argc--; argc < sizeof(Vals)/sizeof(Vals[0]); ++argc)
+ Test(Vals[argc].A, Vals[argc].V);
return 0;
}