| 1 |
// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown-unknown %s -o - | FileCheck %s |
| 2 |
|
| 3 |
// CHECK: @_ZL2v1 ={{.*}} global i32 0, code_model "small" |
| 4 |
static int v1 __attribute__((model("small"))); |
| 5 |
|
| 6 |
void use1() { |
| 7 |
v1 = 1; |
| 8 |
} |
| 9 |
|
| 10 |
// CHECK: @v2 ={{.*}} global float 0.000000e+00, code_model "large" |
| 11 |
float v2 __attribute__((model("large"))); |
| 12 |
|
| 13 |
// CHECK: @_ZL2v3IiE ={{.*}} global i32 0, code_model "small" |
| 14 |
template <typename T> |
| 15 |
static T v3 __attribute__((model("small"))); |
| 16 |
|
| 17 |
void use2() { |
| 18 |
v3<int> = 1; |
| 19 |
} |
| 20 |
struct S { |
| 21 |
double d; |
| 22 |
}; |
| 23 |
|
| 24 |
typedef void (*F)(); |
| 25 |
|
| 26 |
// CHECK: @v4 ={{.*}} global ptr null, code_model "large" |
| 27 |
F v4 __attribute__((model("large"))); |