[llvm-branch-commits] [clang] c421412 - Fixed C test case
Albion Fung via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Jun 25 11:55:05 PDT 2021
Author: Albion Fung
Date: 2021-06-25T13:54:53-05:00
New Revision: c42141216e05b92eedebdaae7565e596d0a7267e
URL: https://github.com/llvm/llvm-project/commit/c42141216e05b92eedebdaae7565e596d0a7267e
DIFF: https://github.com/llvm/llvm-project/commit/c42141216e05b92eedebdaae7565e596d0a7267e.diff
LOG: Fixed C test case
Added:
clang/test/CodeGen/builtins-ppc-xlcompat-conversionfunc.c
clang/test/CodeGen/builtins-ppc-xlcompat-trap.c
Modified:
Removed:
llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-conversionfunc.c
llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-trap.c
################################################################################
diff --git a/llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-conversionfunc.c b/clang/test/CodeGen/builtins-ppc-xlcompat-conversionfunc.c
similarity index 75%
rename from llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-conversionfunc.c
rename to clang/test/CodeGen/builtins-ppc-xlcompat-conversionfunc.c
index f401cd8cf7c77..c72ede258c6aa 100644
--- a/llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-conversionfunc.c
+++ b/clang/test/CodeGen/builtins-ppc-xlcompat-conversionfunc.c
@@ -10,111 +10,111 @@
double test_fcfid(double a) {
// CHECK-LABEL: test_fcfid
// CHECK-NEXT: entry:
- // CHECK: double @llvm.ppc.fcfid(double %0)
+ // CHECK: double @llvm.ppc.fcfid(double %a)
return __builtin_ppc_fcfid(a);
}
double test_xl_fcfid(double a) {
// CHECK-LABEL: test_xl_fcfid
// CHECK-NEXT: entry:
- // CHECK: double @llvm.ppc.fcfid(double %0)
+ // CHECK: double @llvm.ppc.fcfid(double %a)
return __fcfid(a);
}
double test_fcfud(double a) {
// CHECK-LABEL: test_fcfud
// CHECK-NEXT: entry:
- // CHECK: double @llvm.ppc.fcfud(double %0)
+ // CHECK: double @llvm.ppc.fcfud(double %a)
return __builtin_ppc_fcfud(a);
}
double test_xl_fcfud(double a) {
// CHECK-LABEL: test_xl_fcfud
// CHECK-NEXT: entry:
- // CHECK: double @llvm.ppc.fcfud(double %0)
+ // CHECK: double @llvm.ppc.fcfud(double %a)
return __fcfud(a);
}
double test_fctid(double a) {
// CHECK-LABEL: test_fctid
// CHECK-NEXT: entry:
- // CHECK: double @llvm.ppc.fctid(double %0)
+ // CHECK: double @llvm.ppc.fctid(double %a)
return __builtin_ppc_fctid(a);
}
double test_xl_fctid(double a) {
// CHECK-LABEL: test_xl_fctid
// CHECK-NEXT: entry:
- // CHECK: double @llvm.ppc.fctid(double %0)
+ // CHECK: double @llvm.ppc.fctid(double %a)
return __fctid(a);
}
double test_fctidz(double a) {
// CHECK-LABEL: test_fctidz
// CHECK-NEXT: entry:
- // CHECK: double @llvm.ppc.fctid(double %0)
+ // CHECK: double @llvm.ppc.fctidz(double %a)
return __builtin_ppc_fctidz(a);
}
double test_xl_fctidz(double a) {
// CHECK-LABEL: test_xl_fctidz
// CHECK-NEXT: entry:
- // CHECK: double @llvm.ppc.fctid(double %0)
+ // CHECK: double @llvm.ppc.fctidz(double %a)
return __fctidz(a);
}
double test_fctiw(double a) {
// CHECK-LABEL: test_fctiw
// CHECK-NEXT: entry:
- // CHECK: double @llvm.ppc.fctid(double %0)
+ // CHECK: double @llvm.ppc.fctiw(double %a)
return __builtin_ppc_fctiw(a);
}
double test_xl_fctiw(double a) {
// CHECK-LABEL: test_xl_fctiw
// CHECK-NEXT: entry:
- // CHECK: double @llvm.ppc.fctid(double %0)
+ // CHECK: double @llvm.ppc.fctiw(double %a)
return __fctiw(a);
}
double test_fctiwz(double a) {
// CHECK-LABEL: test_fctiwz
// CHECK-NEXT: entry:
- // CHECK: double @llvm.ppc.fctid(double %0)
+ // CHECK: double @llvm.ppc.fctiwz(double %a)
return __builtin_ppc_fctiwz(a);
}
double test_xl_fctiwz(double a) {
// CHECK-LABEL: test_xl_fctiwz
// CHECK-NEXT: entry:
- // CHECK: double @llvm.ppc.fctid(double %0)
+ // CHECK: double @llvm.ppc.fctiwz(double %a)
return __fctiwz(a);
}
double test_fctudz(double a) {
// CHECK-LABEL: test_fctudz
// CHECK-NEXT: entry:
- // CHECK: double @llvm.ppc.fctid(double %0)
+ // CHECK: double @llvm.ppc.fctudz(double %a)
return __builtin_ppc_fctudz(a);
}
double test_xl_fctudz(double a) {
// CHECK-LABEL: test_xl_fctudz
// CHECK-NEXT: entry:
- // CHECK: double @llvm.ppc.fctid(double %0)
+ // CHECK: double @llvm.ppc.fctudz(double %a)
return __fctudz(a);
}
double test_fctuwz(double a) {
// CHECK-LABEL: test_fctuwz
// CHECK-NEXT: entry:
- // CHECK: double @llvm.ppc.fctid(double %0)
+ // CHECK: double @llvm.ppc.fctuwz(double %a)
return __builtin_ppc_fctuwz(a);
}
double test_xl_fctuwz(double a) {
// CHECK-LABEL: test_xl_fctuwz
// CHECK-NEXT: entry:
- // CHECK: double @llvm.ppc.fctid(double %0)
+ // CHECK: double @llvm.ppc.fctuwz(double %a)
return __fctuwz(a);
-}
\ No newline at end of file
+}
diff --git a/clang/test/CodeGen/builtins-ppc-xlcompat-trap.c b/clang/test/CodeGen/builtins-ppc-xlcompat-trap.c
new file mode 100644
index 0000000000000..bd66b34773cdb
--- /dev/null
+++ b/clang/test/CodeGen/builtins-ppc-xlcompat-trap.c
@@ -0,0 +1,68 @@
+// RUN: %clang_cc1 -O2 -triple powerpc64-unknown-unknown \
+// RUN: -emit-llvm %s -o - -target-cpu pwr9 | \
+// RUN: FileCheck %s --check-prefixes=CHECK64,CHECK
+// RUN: %clang_cc1 -O2 -triple powerpc64le-unknown-unknown \
+// RUN: -emit-llvm %s -o - -target-cpu pwr9 | \
+// RUN: FileCheck %s --check-prefixes=CHECK64,CHECK
+// RUN: %clang_cc1 -O2 -triple powerpc-unknown-aix \
+// RUN: -emit-llvm %s -o - -target-cpu pwr9 | \
+// RUN: FileCheck %s -check-prefixes=CHECK
+// RUN: %clang_cc1 -O2 -triple powerpc64-unknown-aix \
+// RUN: -emit-llvm %s -o - -target-cpu pwr9 | \
+// RUN: FileCheck %s --check-prefixes=CHECK64,CHECK
+
+long long lla, llb;
+double da;
+int ia, ib;
+
+#ifdef __ppc64__
+// tdw
+void test_xl_tdw(void) {
+// CHECK64: void @llvm.ppc.tdw(i64 %0, i64 %1, i32 1)
+
+ __tdw(lla, llb, 1);
+}
+
+void test_tdw(void) {
+// CHECK64: void @llvm.ppc.tdw(i64 %0, i64 %1, i32 13)
+
+ __builtin_ppc_tdw(lla, llb, 13);
+}
+#endif
+
+// td
+void test_tw(void) {
+// CHECK: void @llvm.ppc.tw(i32 %0, i32 %1, i32 1)
+
+ __builtin_ppc_tw(ia, ib, 1);
+}
+
+void test_xl_tw(void) {
+// CHECK: void @llvm.ppc.tw(i32 %0, i32 %1, i32 1)
+
+ __tw(ia, ib, 1);
+}
+
+// trap
+void test_trap(void) {
+// CHECK: void @llvm.ppc.trap(i32 %0)
+ __builtin_ppc_trap(ia);
+}
+
+void test_xl_trap(void) {
+// CHECK: void @llvm.ppc.trap(i32 %0)
+ __trap(ia);
+}
+
+#ifdef __PPC64__
+// trapd
+void test_trapd(void) {
+// CHECK64: void @llvm.ppc.trapd(i64 %conv)
+ __builtin_ppc_trapd(da);
+}
+
+void test_xl_trapd(void) {
+// CHECK64: void @llvm.ppc.trapd(i64 %conv)
+ __trapd(da);
+}
+#endif
diff --git a/llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-trap.c b/llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-trap.c
deleted file mode 100644
index 2f5e2e6f7eea4..0000000000000
--- a/llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-trap.c
+++ /dev/null
@@ -1,80 +0,0 @@
-// RUN: %clang_cc1 -O2 -triple powerpc64-unknown-unknown \
-// RUN: -emit-llvm %s -o - -target-cpu pwr9 | FileCheck %s
-// RUN: %clang_cc1 -O2 -triple powerpc64le-unknown-unknown \
-// RUN: -emit-llvm %s -o - -target-cpu pwr9 | FileCheck %s
-// RUN: %clang_cc1 -O2 -triple powerpc-unknown-aix \
-// RUN: -emit-llvm %s -o - -target-cpu pwr9 | FileCheck %s
-// RUN: %clang_cc1 -O2 -triple powerpc64-unknown-aix \
-// RUN: -emit-llvm %s -o - -target-cpu pwr9 | FileCheck %s
-
-long long lla, llb;
-double da;
-int ia, ib;
-
-#ifndef __PPC64__
-// tdw
-void test_xl_tdw(void) {
-// CHECK-LABEL: test_xl_tdw
-// CHECK-NEXT: entry:
-// CHECK: void @llvm.ppc.tdw(i64 %0, i64 %1, i32 1)
-
- __tdw(lla, llb, 1);
-}
-
-void test_tdw(void) {
-// CHECK-LABEL: test_tdw
-// CHECK-NEXT: entry:
-// CHECK: void @llvm.ppc.tdw(i64 %0, i64 %1, i32 13)
-
- __builtin_ppc_tdw(lla, llb, 13);
-}
-#endif
-
-// td
-void test_tw(void) {
-// CHECK-LABEL: test_tw
-// CHECK-NEXT: entry:
-// CHECK: void @llvm.ppc.tw(i32 %0, i32 %1, i32 1)
-
- __builtin_ppc_tw(ia, ib, 1);
-}
-
-void test_xl_tw(void) {
-// CHECK-LABEL: test_xl_tw
-// CHECK-NEXT: entry:
-// CHECK: void @llvm.ppc.tw(i32 %0, i32 %1, i32 1)
-
- __tw(ia, ib, 1);
-}
-
-// trap
-void test_trap(void) {
-// CHECK-LABEL: test_trapd
-// CHECK-NEXT: entry:
-// CHECK: void @llvm.ppc.trap(i32 %0)
- __builtin_ppc_trap(ia);
-}
-
-void test_xl_trap(void) {
-// CHECK-LABEL: test_xl_trapd
-// CHECK-NEXT: entry:
-// CHECK: void @llvm.ppc.trapd(i32 %0)
- __trap(ia);
-}
-
-#ifndef __PPC64__
-// trapd
-void test_trapd(void) {
-// CHECK-LABEL: test_trapd
-// CHECK-NEXT: entry:
-// CHECK: void @llvm.ppc.trapd(i64 %0)
- __builtin_ppc_trapd(da);
-}
-
-void test_xl_trapd(void) {
-// CHECK-LABEL: test_xl_trapd
-// CHECK-NEXT: entry:
-// CHECK: void @llvm.ppc.trapd(i64 %0)
- __trapd(da);
-}
-#endif
More information about the llvm-branch-commits
mailing list