| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,4 +13,5 @@ add_clang_library(clangInstallAPI | |
| LINK_LIBS | ||
| clangAST | ||
| clangBasic | ||
| clangLex | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -135,4 +135,5 @@ add_clang_library(clangTooling | |
| clangRewrite | ||
| clangSerialization | ||
| clangToolingCore | ||
| ${LLVM_PTHREAD_LIB} | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ | ||
| // RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ | ||
| // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \ | ||
| // RUN: --check-prefixes=CHECK,NATIVE_HALF | ||
| // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ | ||
| // RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ | ||
| // RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF | ||
|
|
||
| // NATIVE_HALF: define noundef half @ | ||
| // NATIVE_HALF: %elt.round = call half @llvm.round.f16( | ||
| // NATIVE_HALF: ret half %elt.round | ||
| // NO_HALF: define noundef float @"?test_round_half@@YA$halff@$halff@@Z"( | ||
| // NO_HALF: %elt.round = call float @llvm.round.f32( | ||
| // NO_HALF: ret float %elt.round | ||
| half test_round_half(half p0) { return round(p0); } | ||
| // NATIVE_HALF: define noundef <2 x half> @ | ||
| // NATIVE_HALF: %elt.round = call <2 x half> @llvm.round.v2f16 | ||
| // NATIVE_HALF: ret <2 x half> %elt.round | ||
| // NO_HALF: define noundef <2 x float> @ | ||
| // NO_HALF: %elt.round = call <2 x float> @llvm.round.v2f32( | ||
| // NO_HALF: ret <2 x float> %elt.round | ||
| half2 test_round_half2(half2 p0) { return round(p0); } | ||
| // NATIVE_HALF: define noundef <3 x half> @ | ||
| // NATIVE_HALF: %elt.round = call <3 x half> @llvm.round.v3f16 | ||
| // NATIVE_HALF: ret <3 x half> %elt.round | ||
| // NO_HALF: define noundef <3 x float> @ | ||
| // NO_HALF: %elt.round = call <3 x float> @llvm.round.v3f32( | ||
| // NO_HALF: ret <3 x float> %elt.round | ||
| half3 test_round_half3(half3 p0) { return round(p0); } | ||
| // NATIVE_HALF: define noundef <4 x half> @ | ||
| // NATIVE_HALF: %elt.round = call <4 x half> @llvm.round.v4f16 | ||
| // NATIVE_HALF: ret <4 x half> %elt.round | ||
| // NO_HALF: define noundef <4 x float> @ | ||
| // NO_HALF: %elt.round = call <4 x float> @llvm.round.v4f32( | ||
| // NO_HALF: ret <4 x float> %elt.round | ||
| half4 test_round_half4(half4 p0) { return round(p0); } | ||
|
|
||
| // CHECK: define noundef float @ | ||
| // CHECK: %elt.round = call float @llvm.round.f32( | ||
| // CHECK: ret float %elt.round | ||
| float test_round_float(float p0) { return round(p0); } | ||
| // CHECK: define noundef <2 x float> @ | ||
| // CHECK: %elt.round = call <2 x float> @llvm.round.v2f32 | ||
| // CHECK: ret <2 x float> %elt.round | ||
| float2 test_round_float2(float2 p0) { return round(p0); } | ||
| // CHECK: define noundef <3 x float> @ | ||
| // CHECK: %elt.round = call <3 x float> @llvm.round.v3f32 | ||
| // CHECK: ret <3 x float> %elt.round | ||
| float3 test_round_float3(float3 p0) { return round(p0); } | ||
| // CHECK: define noundef <4 x float> @ | ||
| // CHECK: %elt.round = call <4 x float> @llvm.round.v4f32 | ||
| // CHECK: ret <4 x float> %elt.round | ||
| float4 test_round_float4(float4 p0) { return round(p0); } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,16 @@ | ||
| // RUN: %clang --target=aarch64-none-elf -march=armv8a+rdm -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-RDM %s | ||
| // RUN: %clang --target=aarch64-none-elf -march=armv8a+rdma -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-RDM %s | ||
| // RUN: %clang --target=aarch64-none-elf -mcpu=generic+rdm -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-RDM %s | ||
| // RUN: %clang --target=aarch64-none-elf -mcpu=falkor -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-RDM %s | ||
| // RUN: %clang --target=aarch64-none-elf -mcpu=thunderx2t99 -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-RDM %s | ||
| // CHECK-RDM: "-target-feature" "+rdm" | ||
|
|
||
| // RUN: %clang --target=aarch64-none-elf -march=armv8a+nordm -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-NORDM %s | ||
| // RUN: %clang --target=aarch64-none-elf -march=armv8a+nordma -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-NORDM %s | ||
| // RUN: %clang --target=aarch64-none-elf -mcpu=generic+nordm -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-NORDM %s | ||
| // CHECK-NORDM-NOT: "-target-feature" "+rdm" | ||
| // | ||
| // RUN: %clang --target=aarch64-none-elf -march=armv8.1a -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-RDM %s | ||
| // RUN: %clang --target=aarch64-none-elf -march=armv8.1a+nordm -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-NORDM-DEFAULT %s | ||
| // RUN: %clang --target=aarch64-none-elf -march=armv8.1a+nordma -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-NORDM-DEFAULT %s | ||
| // CHECK-NORDM-DEFAULT: "-target-feature" "-rdm" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| // Test that -print-library-module-manifest-path finds the correct file. | ||
|
|
||
| // FIXME: Enable on all platforms. | ||
|
|
||
| // REQUIRES: x86-registered-target | ||
|
|
||
| // RUN: rm -rf %t && split-file %s %t && cd %t | ||
| // RUN: mkdir -p %t/Inputs/usr/lib/x86_64-linux-gnu | ||
| // RUN: touch %t/Inputs/usr/lib/x86_64-linux-gnu/libc++.so | ||
|
|
||
| // RUN: %clang -print-library-module-manifest-path \ | ||
| // RUN: -stdlib=libc++ \ | ||
| // RUN: --sysroot=%t/Inputs \ | ||
| // RUN: --target=x86_64-linux-gnu 2>&1 \ | ||
| // RUN: | FileCheck libcxx-no-module-json.cpp | ||
|
|
||
| // RUN: touch %t/Inputs/usr/lib/x86_64-linux-gnu/modules.json | ||
| // RUN: %clang -print-library-module-manifest-path \ | ||
| // RUN: -stdlib=libc++ \ | ||
| // RUN: --sysroot=%t/Inputs \ | ||
| // RUN: --target=x86_64-linux-gnu 2>&1 \ | ||
| // RUN: | FileCheck libcxx.cpp | ||
|
|
||
| // RUN: %clang -print-library-module-manifest-path \ | ||
| // RUN: -stdlib=libstdc++ \ | ||
| // RUN: --sysroot=%t/Inputs \ | ||
| // RUN: --target=x86_64-linux-gnu 2>&1 \ | ||
| // RUN: | FileCheck libstdcxx.cpp | ||
|
|
||
| //--- libcxx-no-module-json.cpp | ||
|
|
||
| // CHECK: <NOT PRESENT> | ||
|
|
||
| //--- libcxx.cpp | ||
|
|
||
| // CHECK: {{.*}}/Inputs/usr/lib/x86_64-linux-gnu{{/|\\}}modules.json | ||
|
|
||
| //--- libstdcxx.cpp | ||
|
|
||
| // CHECK: <NOT PRESENT> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| // RUN: rm -rf %t | ||
| // RUN: split-file %s %t | ||
| // RUN: sed -e "s|DSTROOT|%/t|g" %t/inputs.json.in > %t/inputs.json | ||
|
|
||
| // RUN: clang-installapi -target arm64-apple-macos13.1 \ | ||
| // RUN: -F%t -install_name /System/Library/Frameworks/Foo.framework/Foo \ | ||
| // RUN: %t/inputs.json -o %t/outputs.tbd -v 2>&1 | FileCheck %s --check-prefix=VERBOSE | ||
| // RUN: llvm-readtapi -compare %t/outputs.tbd %t/expected.tbd 2>&1 | FileCheck %s --allow-empty | ||
|
|
||
| // VERBOSE: Public Headers: | ||
| // VERBOSE-NEXT: #import <Foo/Foo.h> | ||
| // CHECK-NOT: error: | ||
| // CHECK-NOT: warning: | ||
|
|
||
| //--- Foo.framework/Headers/Foo.h | ||
| // Ignore forward declaration. | ||
| @class NSObject; | ||
|
|
||
| @interface Visible | ||
| @end | ||
|
|
||
| __attribute__((visibility("hidden"))) | ||
| @interface Hidden | ||
| @end | ||
|
|
||
| __attribute__((objc_exception)) | ||
| @interface Exception | ||
| @end | ||
|
|
||
| //--- inputs.json.in | ||
| { | ||
| "headers": [ { | ||
| "path" : "DSTROOT/Foo.framework/Headers/Foo.h", | ||
| "type" : "public" | ||
| }], | ||
| "version": "3" | ||
| } | ||
|
|
||
| //--- expected.tbd | ||
| { | ||
| "main_library": { | ||
| "compatibility_versions": [ | ||
| { | ||
| "version": "0" | ||
| } | ||
| ], | ||
| "current_versions": [ | ||
| { | ||
| "version": "0" | ||
| } | ||
| ], | ||
| "exported_symbols": [ | ||
| { | ||
| "data": { | ||
| "objc_class": [ | ||
| "Exception", | ||
| "Visible" | ||
| ], | ||
| "objc_eh_type": [ | ||
| "Exception" | ||
| ] | ||
| } | ||
| } | ||
| ], | ||
| "flags": [ | ||
| { | ||
| "attributes": [ | ||
| "not_app_extension_safe" | ||
| ] | ||
| } | ||
| ], | ||
| "install_names": [ | ||
| { | ||
| "name": "/System/Library/Frameworks/Foo.framework/Foo" | ||
| } | ||
| ], | ||
| "target_info": [ | ||
| { | ||
| "min_deployment": "13.1", | ||
| "target": "arm64-macos" | ||
| } | ||
| ] | ||
| }, | ||
| "tapi_tbd_version": 5 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // RUN: %clang_cc1 -verify -fsyntax-only -fdump-record-layouts-complete %s | ||
|
|
||
| struct Incomplete; // expected-note {{forward declaration}} | ||
|
|
||
| // Check we don't crash on trying to print out an invalid declaration. | ||
| struct Invalid : Incomplete {}; // expected-error {{base class has incomplete type}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
|
|
||
| // RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -verify -verify-ignore-unexpected | ||
|
|
||
| float test_too_few_arg() { | ||
| return __builtin_elementwise_round(); | ||
| // expected-error@-1 {{too few arguments to function call, expected 1, have 0}} | ||
| } | ||
|
|
||
| float2 test_too_many_arg(float2 p0) { | ||
| return __builtin_elementwise_round(p0, p0); | ||
| // expected-error@-1 {{too many arguments to function call, expected 1, have 2}} | ||
| } | ||
|
|
||
| float builtin_bool_to_float_type_promotion(bool p1) { | ||
| return __builtin_elementwise_round(p1); | ||
| // expected-error@-1 {{1st argument must be a vector, integer or floating point type (was 'bool')}} | ||
| } | ||
|
|
||
| float builtin_round_int_to_float_promotion(int p1) { | ||
| return __builtin_elementwise_round(p1); | ||
| // expected-error@-1 {{1st argument must be a floating point type (was 'int')}} | ||
| } | ||
|
|
||
| float2 builtin_round_int2_to_float2_promotion(int2 p1) { | ||
| return __builtin_elementwise_round(p1); | ||
| // expected-error@-1 {{1st argument must be a floating point type (was 'int2' (aka 'vector<int, 2>'))}} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,13 @@ | ||
| //===-- lib/extendbfsf2.c - bfloat -> single conversion -----------*- C -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #define SRC_BFLOAT16 | ||
| #define DST_SINGLE | ||
| #include "fp_extend_impl.inc" | ||
|
|
||
| COMPILER_RT_ABI float __extendbfsf2(src_t a) { return __extendXfYf2__(a); } |