• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -triple i686-windows-gnu -emit-llvm -o - %s \
2 // RUN:    | FileCheck %s --check-prefix=GNU32
3 // RUN: %clang_cc1 -triple x86_64-windows-gnu -emit-llvm -o - %s \
4 // RUN:    | FileCheck %s --check-prefix=GNU64
5 // RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm -o - %s \
6 // RUN:    | FileCheck %s --check-prefix=MSC64
7 
8 struct {
9   char c;
10   long double ldb;
11 } agggregate_LD = {};
12 // GNU32: %struct.anon = type { i8, x86_fp80 }
13 // GNU32: @agggregate_LD = global %struct.anon zeroinitializer, align 4
14 // GNU64: %struct.anon = type { i8, x86_fp80 }
15 // GNU64: @agggregate_LD = global %struct.anon zeroinitializer, align 16
16 // MSC64: %struct.anon = type { i8, double }
17 // MSC64: @agggregate_LD = global %struct.anon zeroinitializer, align 8
18 
19 long double dataLD = 1.0L;
20 // GNU32: @dataLD = global x86_fp80 0xK3FFF8000000000000000, align 4
21 // GNU64: @dataLD = global x86_fp80 0xK3FFF8000000000000000, align 16
22 // MSC64: @dataLD = global double 1.000000e+00, align 8
23 
24 long double _Complex dataLDC = {1.0L, 1.0L};
25 // GNU32: @dataLDC = global { x86_fp80, x86_fp80 } { x86_fp80 0xK3FFF8000000000000000, x86_fp80 0xK3FFF8000000000000000 }, align 4
26 // GNU64: @dataLDC = global { x86_fp80, x86_fp80 } { x86_fp80 0xK3FFF8000000000000000, x86_fp80 0xK3FFF8000000000000000 }, align 16
27 // MSC64: @dataLDC = global { double, double } { double 1.000000e+00, double 1.000000e+00 }, align 8
28 
TestLD(long double x)29 long double TestLD(long double x) {
30   return x * x;
31 }
32 // GNU32: define x86_fp80 @TestLD(x86_fp80 %x)
33 // GNU64: define void @TestLD(x86_fp80* noalias sret %agg.result, x86_fp80*)
34 // MSC64: define double @TestLD(double %x)
35 
TestLDC(long double _Complex x)36 long double _Complex TestLDC(long double _Complex x) {
37   return x * x;
38 }
39 // GNU32: define void @TestLDC({ x86_fp80, x86_fp80 }* noalias sret %agg.result, { x86_fp80, x86_fp80 }* byval align 4 %x)
40 // GNU64: define void @TestLDC({ x86_fp80, x86_fp80 }* noalias sret %agg.result, { x86_fp80, x86_fp80 }* %x)
41 // MSC64: define void @TestLDC({ double, double }* noalias sret %agg.result, { double, double }* %x)
42