summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-02-21 13:52:32 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-02-21 13:52:32 +0000
commit4d7895b3fe2123cd634a3add8489cf4e2579f5ac (patch)
treebd18d1c977939c5f886a223455028f9784d044ac /test
parentd4aec3a22f5b4c987be1c3815fdadbac72c6de5b (diff)
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/arm-vfp-asm-constraint.c36
-rw-r--r--test/CodeGenCXX/windows-on-arm-stack-probe-size.cpp13
-rw-r--r--test/Driver/freebsd.cpp11
-rw-r--r--test/OpenMP/for_ast_print.cpp12
-rw-r--r--test/OpenMP/for_lastprivate_codegen.cpp15
-rw-r--r--test/OpenMP/parallel_messages.cpp5
6 files changed, 77 insertions, 15 deletions
diff --git a/test/CodeGen/arm-vfp-asm-constraint.c b/test/CodeGen/arm-vfp-asm-constraint.c
new file mode 100644
index 000000000000..21f7362b0f90
--- /dev/null
+++ b/test/CodeGen/arm-vfp-asm-constraint.c
@@ -0,0 +1,36 @@
+// REQUIRES: arm-registered-target
+// RUN: %clang_cc1 -triple armv7-unknown-unknown -mfpmath vfp -emit-llvm -o - %s | FileCheck %s
+
+// CHECK-NOT: error:
+
+double fabs(double x) { // CHECK-LABEL: @fabs(
+ // CHECK: call double asm "vabs.f64 ${0:P}, ${1:P}", "=w,w"(double
+ __asm__("vabs.f64 %P0, %P1"
+ : "=w"(x)
+ : "w"(x));
+ return x;
+}
+
+float fabsf(float x) { // CHECK-LABEL: @fabsf(
+ // CHECK: call float asm "vabs.f32 $0, $1", "=t,t"(float
+ __asm__("vabs.f32 %0, %1"
+ : "=t"(x)
+ : "t"(x));
+ return x;
+}
+
+double sqrt(double x) { // CHECK-LABEL: @sqrt(
+ // CHECK: call double asm "vsqrt.f64 ${0:P}, ${1:P}", "=w,w"(double
+ __asm__("vsqrt.f64 %P0, %P1"
+ : "=w"(x)
+ : "w"(x));
+ return x;
+}
+
+float sqrtf(float x) { // CHECK-LABEL: @sqrtf(
+ // CHECK: call float asm "vsqrt.f32 $0, $1", "=t,t"(float
+ __asm__("vsqrt.f32 %0, %1"
+ : "=t"(x)
+ : "t"(x));
+ return x;
+}
diff --git a/test/CodeGenCXX/windows-on-arm-stack-probe-size.cpp b/test/CodeGenCXX/windows-on-arm-stack-probe-size.cpp
new file mode 100644
index 000000000000..235d8a0c465f
--- /dev/null
+++ b/test/CodeGenCXX/windows-on-arm-stack-probe-size.cpp
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -triple thumbv7--windows-msvc -S -emit-llvm -o - -x c++ %s | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv7--windows-itanium -fno-use-cxa-atexit -S -emit-llvm -o - -x c++ %s | FileCheck %s
+
+class C {
+public:
+ ~C();
+};
+
+static C sc;
+void f(const C &ci) { sc = ci; }
+
+// CHECK: atexit
+
diff --git a/test/Driver/freebsd.cpp b/test/Driver/freebsd.cpp
index dea3267233cc..175b873bf402 100644
--- a/test/Driver/freebsd.cpp
+++ b/test/Driver/freebsd.cpp
@@ -2,5 +2,12 @@
// RUN: | FileCheck --check-prefix=CHECK-TEN %s
// RUN: %clangxx %s -### -o %t.o -target amd64-unknown-freebsd9.2 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NINE %s
-// CHECK-TEN: -lc++
-// CHECK-NINE: -lstdc++
+// CHECK-TEN: "-lc++" "-lm"
+// CHECK-NINE: "-lstdc++" "-lm"
+
+// RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd10.0 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-PG-TEN %s
+// RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd9.2 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-PG-NINE %s
+// CHECK-PG-TEN: "-lc++_p" "-lm_p"
+// CHECK-PG-NINE: "-lstdc++_p" "-lm_p"
diff --git a/test/OpenMP/for_ast_print.cpp b/test/OpenMP/for_ast_print.cpp
index 8fd82e7f028b..3510b904b1c7 100644
--- a/test/OpenMP/for_ast_print.cpp
+++ b/test/OpenMP/for_ast_print.cpp
@@ -68,6 +68,18 @@ int main(int argc, char **argv) {
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: for (int j = 0; j < 10; ++j)
// CHECK-NEXT: foo();
+ char buf[9] = "01234567";
+ char *p, *q;
+#pragma omp parallel
+#pragma omp for
+ for (p = buf; p < &buf[8]; p++)
+ for (q = &buf[0]; q <= buf + 7; q++)
+ foo();
+ // CHECK: #pragma omp parallel
+ // CHECK-NEXT: #pragma omp for
+ // CHECK-NEXT: for (p = buf; p < &buf[8]; p++)
+ // CHECK-NEXT: for (q = &buf[0]; q <= buf + 7; q++)
+ // CHECK-NEXT: foo();
return (tmain<int, 5>(argc) + tmain<char, 1>(argv[0][0]));
}
diff --git a/test/OpenMP/for_lastprivate_codegen.cpp b/test/OpenMP/for_lastprivate_codegen.cpp
index 36abd8df07cb..ea559b08eae0 100644
--- a/test/OpenMP/for_lastprivate_codegen.cpp
+++ b/test/OpenMP/for_lastprivate_codegen.cpp
@@ -396,20 +396,9 @@ int main() {
// CHECK: br i1 [[IS_LAST_ITER:%.+]], label %[[LAST_THEN:.+]], label %[[LAST_DONE:.+]]
// CHECK: [[LAST_THEN]]
-// Calculate last iter count
-// CHECK: store i32 1, i32* [[OMP_IV]]
-// CHECK: [[IV1_1:%.+]] = load i32, i32* [[OMP_IV]]
-// CHECK-NEXT: [[CALC_I_2:%.+]] = add nsw i32 [[IV1_1]], 1
-// CHECK-NEXT: store i32 [[CALC_I_2]], i32* [[OMP_IV]]
-// Actual copying.
-
-// original cnt=private_cnt;
// Calculate private cnt value.
-// CHECK: [[IV1_1:%.+]] = load i32, i32* [[OMP_IV]]
-// CHECK: [[MUL:%.+]] = mul nsw i32 [[IV1_1]], 1
-// CHECK: [[ADD:%.+]] = add nsw i32 0, [[MUL]]
-// CHECK: [[CONV:%.+]] = trunc i32 [[ADD]] to i8
-// CHECK: store i8 [[CONV]], i8* [[CNT_PRIV]]
+// CHECK: store i8 2, i8* [[CNT_PRIV]]
+// original cnt=private_cnt;
// CHECK: [[CNT_VAL:%.+]] = load i8, i8* [[CNT_PRIV]],
// CHECK: store i8 [[CNT_VAL]], i8* [[CNT]],
diff --git a/test/OpenMP/parallel_messages.cpp b/test/OpenMP/parallel_messages.cpp
index 8aee8414f034..4db55a019549 100644
--- a/test/OpenMP/parallel_messages.cpp
+++ b/test/OpenMP/parallel_messages.cpp
@@ -5,7 +5,12 @@ void foo() {
#pragma omp parallel // expected-error {{unexpected OpenMP directive '#pragma omp parallel'}}
+struct S;
+S& bar();
int main(int argc, char **argv) {
+ S &s = bar();
+ #pragma omp parallel
+ (void)&s;
#pragma omp parallel { // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}
foo();
#pragma omp parallel ( // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}