blob: dbf00d72e40eb87439a2671e8519544fabf47e84 [file] [log] [blame]
Eric Christopher11acf732015-06-12 01:35:52 +00001// RUN: %clang_cc1 -triple x86_64-linux-gnu -target-cpu x86-64 -emit-llvm %s -o - | FileCheck %s
2
3int baz(int a) { return 4; }
4
5int __attribute__((target("avx,sse4.2,arch=ivybridge"))) foo(int a) { return 4; }
6
7int bar(int a) { return baz(a) + foo(a); }
8
9// Check that we emit the additional subtarget and cpu features for foo and not for baz or bar.
10// CHECK: baz{{.*}} #0
11// CHECK: foo{{.*}} #1
12// CHECK: bar{{.*}} #0
13// CHECK: #0 = {{.*}}"target-cpu"="x86-64" "target-features"="+sse,+sse2"
14// CHECK: #1 = {{.*}}"target-cpu"="ivybridge" "target-features"="+sse,+sse2,+avx,+sse4.2"