[cfe-commits] r172344 - /cfe/trunk/test/CodeGen/builtins-multiprecision.c
NAKAMURA Takumi
geek4civic at gmail.com
Sat Jan 12 19:55:21 PST 2013
Author: chapuni
Date: Sat Jan 12 21:55:21 2013
New Revision: 172344
URL: http://llvm.org/viewvc/llvm-project?rev=172344&view=rev
Log:
clang/test/CodeGen/builtins-multiprecision.c: Enhance for each test to run on theree targets, i686, amd64, win64.
Modified:
cfe/trunk/test/CodeGen/builtins-multiprecision.c
Modified: cfe/trunk/test/CodeGen/builtins-multiprecision.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins-multiprecision.c?rev=172344&r1=172343&r2=172344&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtins-multiprecision.c (original)
+++ cfe/trunk/test/CodeGen/builtins-multiprecision.c Sat Jan 12 21:55:21 2013
@@ -1,4 +1,6 @@
+// RUN: %clang_cc1 -triple "i686-unknown-unknown" -emit-llvm -x c %s -o - -O3 | FileCheck %s
// RUN: %clang_cc1 -triple "x86_64-unknown-unknown" -emit-llvm -x c %s -o - -O3 | FileCheck %s
+// RUN: %clang_cc1 -triple "x86_64-mingw32" -emit-llvm -x c %s -o - -O3 | FileCheck %s
unsigned short test_addcs(unsigned short x, unsigned short y,
unsigned short carryin, unsigned short *z) {
@@ -38,16 +40,17 @@
unsigned long test_addcl(unsigned long x, unsigned long y,
unsigned long carryin, unsigned long *z) {
- // CHECK: @test_addcl
- // CHECK: %{{.+}} = {{.*}} call { i64, i1 } @llvm.uadd.with.overflow.i64(i64 %x, i64 %y)
- // CHECK: %{{.+}} = extractvalue { i64, i1 } %{{.+}}, 1
- // CHECK: %{{.+}} = extractvalue { i64, i1 } %{{.+}}, 0
- // CHECK: %{{.+}} = {{.*}} call { i64, i1 } @llvm.uadd.with.overflow.i64(i64 %{{.+}}, i64 %carryin)
- // CHECK: %{{.+}} = extractvalue { i64, i1 } %{{.+}}, 1
- // CHECK: %{{.+}} = extractvalue { i64, i1 } %{{.+}}, 0
+ // long is i32 on i686, i64 on x86_64.
+ // CHECK: @test_addcl([[UL:i32|i64]] %x
+ // CHECK: %{{.+}} = {{.*}} call { [[UL]], i1 } @llvm.uadd.with.overflow.[[UL]]([[UL]] %x, [[UL]] %y)
+ // CHECK: %{{.+}} = extractvalue { [[UL]], i1 } %{{.+}}, 1
+ // CHECK: %{{.+}} = extractvalue { [[UL]], i1 } %{{.+}}, 0
+ // CHECK: %{{.+}} = {{.*}} call { [[UL]], i1 } @llvm.uadd.with.overflow.[[UL]]([[UL]] %{{.+}}, [[UL]] %carryin)
+ // CHECK: %{{.+}} = extractvalue { [[UL]], i1 } %{{.+}}, 1
+ // CHECK: %{{.+}} = extractvalue { [[UL]], i1 } %{{.+}}, 0
// CHECK: %{{.+}} = or i1 %{{.+}}, %{{.+}}
- // CHECK: %{{.+}} = zext i1 %{{.+}} to i64
- // CHECK: store i64 %{{.+}}, i64* %z, align 8
+ // CHECK: %{{.+}} = zext i1 %{{.+}} to [[UL]]
+ // CHECK: store [[UL]] %{{.+}}, [[UL]]* %z
unsigned long carryout;
*z = __builtin_addcl(x, y, carryin, &carryout);
@@ -66,7 +69,7 @@
// CHECK: %{{.+}} = extractvalue { i64, i1 } %{{.+}}, 0
// CHECK: %{{.+}} = or i1 %{{.+}}, %{{.+}}
// CHECK: %{{.+}} = zext i1 %{{.+}} to i64
- // CHECK: store i64 %{{.+}}, i64* %z, align 8
+ // CHECK: store i64 %{{.+}}, i64* %z
unsigned long long carryout;
*z = __builtin_addcll(x, y, carryin, &carryout);
More information about the cfe-commits
mailing list