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