From 64e62dcfff8eb68118ac9d5f8c3de1733505cb70 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 30 Apr 2018 16:26:57 +0000 Subject: [OPENMP] Do not crash on incorrect input data. Emit error messages instead of compiler crashing when the target region does not exist in the device code + fix crash when the location comes from macros. llvm-svn: 331195 --- clang/test/OpenMP/target_codegen.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/test/OpenMP/target_codegen.cpp') diff --git a/clang/test/OpenMP/target_codegen.cpp b/clang/test/OpenMP/target_codegen.cpp index e75ea738c8e..618a5be995b 100644 --- a/clang/test/OpenMP/target_codegen.cpp +++ b/clang/test/OpenMP/target_codegen.cpp @@ -80,6 +80,7 @@ // TCHECK: @{{.+}} = weak constant [[ENTTY]] // TCHECK: @{{.+}} = weak constant [[ENTTY]] // TCHECK: @{{.+}} = {{.*}}constant [[ENTTY]] +// TCHECK: @{{.+}} = {{.*}}constant [[ENTTY]] // TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]] // Check if offloading descriptor is created. @@ -750,4 +751,10 @@ int bar(int n){ // CHECK-32-DAG: load i32, i32* [[LOCAL_A]] // CHECK-DAG: load i16, i16* [[REF_AA]] // CHECK-DAG: getelementptr inbounds [10 x i32], [10 x i32]* [[REF_B]], i[[SZ]] 0, i[[SZ]] 2 + +void bar () { +#define pragma_target _Pragma("omp target") +pragma_target +{} +} #endif -- cgit v1.2.3