Eric Christopher | 11acf73 | 2015-06-12 01:35:52 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -triple x86_64-linux-gnu -target-cpu x86-64 -emit-llvm %s -o - | FileCheck %s |
| 2 | |
| 3 | int baz(int a) { return 4; } |
| 4 | |
| 5 | int __attribute__((target("avx,sse4.2,arch=ivybridge"))) foo(int a) { return 4; } |
| 6 | |
| 7 | int 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" |