summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/attr-cpuspecific.cpp
diff options
context:
space:
mode:
authorTom Stellard <tstellar@redhat.com>2018-12-08 04:54:24 +0000
committerTom Stellard <tstellar@redhat.com>2018-12-08 04:54:24 +0000
commit0a9b9e6746d87a4dc929be9622c0f559cb2c119b (patch)
treea4df67275839a23da83b36b10485e060de68060c /clang/test/CodeGenCXX/attr-cpuspecific.cpp
parent5a9000ba8358f77796e23ba7ab13a3250b1b726d (diff)
downloadbcm5719-llvm-0a9b9e6746d87a4dc929be9622c0f559cb2c119b.tar.gz
bcm5719-llvm-0a9b9e6746d87a4dc929be9622c0f559cb2c119b.zip
Merging r345838:
------------------------------------------------------------------------ r345838 | erichkeane | 2018-11-01 08:11:41 -0700 (Thu, 01 Nov 2018) | 8 lines CPU-Dispatch- Fix type of a member function, prevent deferrals The member type creation for a cpu-dispatch function was not correctly including the 'this' parameter, so ensure that the type is properly determined. Also, disable defer in the cases of emitting the functoins, as it can end up resulting in the wrong version being emitted. Change-Id: I0b8fc5e0b0d1ae1a9d98fd54f35f27f6e5d5d083 ------------------------------------------------------------------------ llvm-svn: 348684
Diffstat (limited to 'clang/test/CodeGenCXX/attr-cpuspecific.cpp')
-rw-r--r--clang/test/CodeGenCXX/attr-cpuspecific.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/attr-cpuspecific.cpp b/clang/test/CodeGenCXX/attr-cpuspecific.cpp
new file mode 100644
index 00000000000..ae5702feb8c
--- /dev/null
+++ b/clang/test/CodeGenCXX/attr-cpuspecific.cpp
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,LINUX
+
+struct S {
+ __attribute__((cpu_specific(atom)))
+ void Func(){}
+ __attribute__((cpu_dispatch(ivybridge,atom)))
+ void Func(){}
+};
+
+void foo() {
+ S s;
+ s.Func();
+}
+
+// LINUX: define void (%struct.S*)* @_ZN1S4FuncEv.resolver
+// LINUX: ret void (%struct.S*)* @_ZN1S4FuncEv.S
+// LINUX: ret void (%struct.S*)* @_ZN1S4FuncEv.O
OpenPOWER on IntegriCloud