1 // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
3 // Should be 3 hello strings, two global (of different sizes), the rest are
6 // CHECK: @align = global i8 [[ALIGN:[0-9]+]]
7 // CHECK: @.str = private unnamed_addr constant [6 x i8] c"hello\00"
8 // CHECK: @f1.x = internal global i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0)
9 // CHECK: @f2.x = internal global [6 x i8] c"hello\00", align [[ALIGN]]
10 // CHECK: @f3.x = internal global [8 x i8] c"hello\00\00\00", align [[ALIGN]]
11 // CHECK: @f4.x = internal global %struct.s { i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0) }
12 // CHECK: @x = global [3 x i8] c"ola", align [[ALIGN]]
14 #if defined(__s390x__)
15 unsigned char align = 2;
17 unsigned char align = 1;
20 void bar(const char *);
22 // CHECK: define void @f0()
25 // CHECK: call void @bar({{.*}} @.str
28 // CHECK: define void @f1()
30 static char *x = "hello";
32 // CHECK: [[T1:%.*]] = load i8** @f1.x
33 // CHECK: call void @bar(i8* [[T1:%.*]])
36 // CHECK: define void @f2()
38 static char x[] = "hello";
40 // CHECK: call void @bar({{.*}} @f2.x
43 // CHECK: define void @f3()
45 static char x[8] = "hello";
47 // CHECK: call void @bar({{.*}} @f3.x
52 // CHECK: define void @f4()
58 // CHECK: call void @gaz({{.*}} @f4.x