diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-07-01 13:24:05 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-07-01 13:24:05 +0000 |
commit | cf1b401909b5e54edfd80656b1a18eaa31f9f6f1 (patch) | |
tree | edb0ffff2a43d84ba9b4c862b394cfeeebb36ddc /test | |
parent | ef915aab0ac566c55bfb0d7a9f6635bb5d94d4af (diff) | |
download | src-test2-cf1b401909b5e54edfd80656b1a18eaa31f9f6f1.tar.gz src-test2-cf1b401909b5e54edfd80656b1a18eaa31f9f6f1.zip |
Notes
Diffstat (limited to 'test')
123 files changed, 3633 insertions, 1659 deletions
diff --git a/test/Analysis/malloc-overflow2.c b/test/Analysis/malloc-overflow2.c index 2e1b1d4d2b24..7c580602e682 100644 --- a/test/Analysis/malloc-overflow2.c +++ b/test/Analysis/malloc-overflow2.c @@ -1,4 +1,5 @@ // RUN: %clang_analyze_cc1 -triple x86_64-unknown-unknown -analyzer-checker=alpha.security.MallocOverflow,unix -verify %s +// RUN: %clang_analyze_cc1 -triple x86_64-unknown-unknown -analyzer-checker=alpha.security.MallocOverflow,unix,optin.portability -DPORTABILITY -verify %s typedef __typeof__(sizeof(int)) size_t; extern void *malloc(size_t); @@ -32,5 +33,8 @@ static int table_build_1(struct table *t) { } void *f(int n) { - return malloc(n * 0 * sizeof(int)); // expected-warning {{Call to 'malloc' has an allocation size of 0 bytes}} + return malloc(n * 0 * sizeof(int)); +#ifdef PORTABILITY + // expected-warning@-2{{Call to 'malloc' has an allocation size of 0 bytes}} +#endif } diff --git a/test/Analysis/unix-fns.c b/test/Analysis/unix-fns.c index 3eccd51d2c60..481f545e28bc 100644 --- a/test/Analysis/unix-fns.c +++ b/test/Analysis/unix-fns.c @@ -1,7 +1,7 @@ -// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,unix.API,osx.API %s -analyzer-store=region -analyzer-output=plist -analyzer-eagerly-assume -analyzer-config faux-bodies=true -analyzer-config path-diagnostics-alternate=false -fblocks -verify -o %t.plist +// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,unix.API,osx.API,optin.portability %s -analyzer-store=region -analyzer-output=plist -analyzer-eagerly-assume -analyzer-config faux-bodies=true -analyzer-config path-diagnostics-alternate=false -fblocks -verify -o %t.plist // RUN: FileCheck --input-file=%t.plist %s // RUN: mkdir -p %t.dir -// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.API,osx.API -analyzer-output=html -analyzer-config faux-bodies=true -fblocks -o %t.dir %s +// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix.API,osx.API,optin.portability -analyzer-output=html -analyzer-config faux-bodies=true -fblocks -o %t.dir %s // RUN: rm -fR %t.dir struct _opaque_pthread_once_t { long __sig; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 23d23bcddcc1..fa926c584f8e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -47,6 +47,7 @@ list(APPEND CLANG_TEST_DEPS clang-tblgen clang-offload-bundler clang-import-test + clang-rename ) if(CLANG_ENABLE_STATIC_ANALYZER) diff --git a/test/CodeGen/arm-execute-only.c b/test/CodeGen/arm-execute-only.c new file mode 100644 index 000000000000..6d88ff611d68 --- /dev/null +++ b/test/CodeGen/arm-execute-only.c @@ -0,0 +1,78 @@ +// RUN: %clang -target armv6t2-eabi -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY + +// RUN: %clang -target armv6t2-eabi -### -mexecute-only %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY + +// RUN: %clang -target armv6t2-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY + +// RUN: %clang -target armv7m-eabi -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY + +// RUN: %clang -target armv7m-eabi -### -mexecute-only %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY + +// RUN: %clang -target armv7m-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY + +// RUN: %clang -target armv8m.base-eabi -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY + +// RUN: %clang -target armv8m.base-eabi -### -mexecute-only %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY + +// RUN: %clang -target armv8m.base-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY + +// RUN: %clang -target armv8m.main-eabi -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY + +// RUN: %clang -target armv8m.main-eabi -### -mexecute-only %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY + +// RUN: %clang -target armv8m.main-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY + + +// -mpure-code flag for GCC compatibility +// RUN: %clang -target armv6t2-eabi -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY + +// RUN: %clang -target armv6t2-eabi -### -mpure-code %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY + +// RUN: %clang -target armv6t2-eabi -### -mpure-code -mno-pure-code %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY + +// RUN: %clang -target armv7m-eabi -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY + +// RUN: %clang -target armv7m-eabi -### -mpure-code %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY + +// RUN: %clang -target armv7m-eabi -### -mpure-code -mno-pure-code %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY + +// RUN: %clang -target armv8m.base-eabi -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY + +// RUN: %clang -target armv8m.base-eabi -### -mpure-code %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY + +// RUN: %clang -target armv8m.base-eabi -### -mpure-code -mno-pure-code %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY + +// RUN: %clang -target armv8m.main-eabi -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY + +// RUN: %clang -target armv8m.main-eabi -### -mpure-code %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY + +// RUN: %clang -target armv8m.main-eabi -### -mpure-code -mno-pure-code %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY + +// CHECK-NO-EXECUTE-ONLY-NOT: "+execute-only" +// CHECK-EXECUTE-ONLY: "+execute-only" + +void a() {} diff --git a/test/CodeGen/arm-v8.1a-neon-intrinsics.c b/test/CodeGen/arm-v8.1a-neon-intrinsics.c index 788883100456..6f5867b6c11f 100644 --- a/test/CodeGen/arm-v8.1a-neon-intrinsics.c +++ b/test/CodeGen/arm-v8.1a-neon-intrinsics.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple armv8.1a-linux-gnu -target-feature +neon \ +// RUN: %clang_cc1 -triple armv8.1a-linux-gnu -target-abi apcs-gnu -target-feature +neon \ // RUN: -S -emit-llvm -o - %s \ // RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-ARM diff --git a/test/CodeGen/avx512f-builtins.c b/test/CodeGen/avx512f-builtins.c index c66d83611ed1..c3356461a348 100644 --- a/test/CodeGen/avx512f-builtins.c +++ b/test/CodeGen/avx512f-builtins.c @@ -1,4 +1,7 @@ // RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512f -emit-llvm -o - -Wall -Werror | FileCheck %s + +// FIXME: It's wrong to check LLVM IR transformations from clang. This run should be removed and tests added to the appropriate LLVM pass. + // RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512f -O2 -emit-llvm -o - -Wall -Werror | FileCheck %s -check-prefix=O2 #include <immintrin.h> @@ -8240,10 +8243,10 @@ __m128 test_mm_mask_move_ss (__m128 __W, __mmask8 __U, __m128 __A, __m128 __B) { // O2-LABEL: @test_mm_mask_move_ss // O2: %[[M:.*]] = and i8 %__U, 1 - // O2: %[[M2:.*]] = icmp ne i8 %[[M]], 0 - // O2: %[[ELM1:.*]] = extractelement <4 x float> %__B, i32 0 - // O2: %[[ELM2:.*]] = extractelement <4 x float> %__W, i32 0 - // O2: %[[SEL:.*]] = select i1 %[[M2]], float %[[ELM1]], float %[[ELM2]] + // O2: %[[M2:.*]] = icmp + // O2: %[[ELM1:.*]] = extractelement <4 x float> + // O2: %[[ELM2:.*]] = extractelement <4 x float> + // O2: %[[SEL:.*]] = select i1 %[[M2]] // O2: %[[RES:.*]] = insertelement <4 x float> %__A, float %[[SEL]], i32 0 // O2: ret <4 x float> %[[RES]] return _mm_mask_move_ss ( __W, __U, __A, __B); @@ -8253,9 +8256,9 @@ __m128 test_mm_maskz_move_ss (__mmask8 __U, __m128 __A, __m128 __B) { // O2-LABEL: @test_mm_maskz_move_ss // O2: %[[M:.*]] = and i8 %__U, 1 - // O2: %[[M2:.*]] = icmp ne i8 %[[M]], 0 + // O2: %[[M2:.*]] = icmp // O2: %[[ELM1:.*]] = extractelement <4 x float> %__B, i32 0 - // O2: %[[SEL:.*]] = select i1 %[[M2]], float %[[ELM1]], float 0.0 + // O2: %[[SEL:.*]] = select i1 %[[M2]] // O2: %[[RES:.*]] = insertelement <4 x float> %__A, float %[[SEL]], i32 0 // O2: ret <4 x float> %[[RES]] return _mm_maskz_move_ss (__U, __A, __B); @@ -8265,10 +8268,10 @@ __m128d test_mm_mask_move_sd (__m128d __W, __mmask8 __U, __m128d __A, __m128d __ { // O2-LABEL: @test_mm_mask_move_sd // O2: %[[M:.*]] = and i8 %__U, 1 - // O2: %[[M2:.*]] = icmp ne i8 %[[M]], 0 - // O2: %[[ELM1:.*]] = extractelement <2 x double> %__B, i32 0 - // O2: %[[ELM2:.*]] = extractelement <2 x double> %__W, i32 0 - // O2: %[[SEL:.*]] = select i1 %[[M2]], double %[[ELM1]], double %[[ELM2]] + // O2: %[[M2:.*]] = icmp + // O2: %[[ELM1:.*]] = extractelement <2 x double> + // O2: %[[ELM2:.*]] = extractelement <2 x double> + // O2: %[[SEL:.*]] = select i1 %[[M2]] // O2: %[[RES:.*]] = insertelement <2 x double> %__A, double %[[SEL]], i32 0 // O2: ret <2 x double> %[[RES]] return _mm_mask_move_sd ( __W, __U, __A, __B); @@ -8278,9 +8281,9 @@ __m128d test_mm_maskz_move_sd (__mmask8 __U, __m128d __A, __m128d __B) { // O2-LABEL: @test_mm_maskz_move_sd // O2: %[[M:.*]] = and i8 %__U, 1 - // O2: %[[M2:.*]] = icmp ne i8 %[[M]], 0 + // O2: %[[M2:.*]] = icmp // O2: %[[ELM1:.*]] = extractelement <2 x double> %__B, i32 0 - // O2: %[[SEL:.*]] = select i1 %[[M2]], double %[[ELM1]], double 0.0 + // O2: %[[SEL:.*]] = select i1 %[[M2]] // O2: %[[RES:.*]] = insertelement <2 x double> %__A, double %[[SEL]], i32 0 // O2: ret <2 x double> %[[RES]] return _mm_maskz_move_sd (__U, __A, __B); diff --git a/test/CodeGen/builtins-wasm.c b/test/CodeGen/builtins-wasm.c index 0c0b87945d42..e0f72d2e5034 100644 --- a/test/CodeGen/builtins-wasm.c +++ b/test/CodeGen/builtins-wasm.c @@ -14,3 +14,15 @@ __SIZE_TYPE__ f2(__SIZE_TYPE__ delta) { // WEBASSEMBLY32: call i32 @llvm.wasm.grow.memory.i32(i32 %{{.*}}) // WEBASSEMBLY64: call i64 @llvm.wasm.grow.memory.i64(i64 %{{.*}}) } + +void f3(unsigned int tag, void *obj) { + return __builtin_wasm_throw(tag, obj); +// WEBASSEMBLY32: call void @llvm.wasm.throw(i32 %{{.*}}, i8* %{{.*}}) +// WEBASSEMBLY64: call void @llvm.wasm.throw(i32 %{{.*}}, i8* %{{.*}}) +} + +void f4() { + return __builtin_wasm_rethrow(); +// WEBASSEMBLY32: call void @llvm.wasm.rethrow() +// WEBASSEMBLY64: call void @llvm.wasm.rethrow() +} diff --git a/test/CodeGen/lto-newpm-pipeline.c b/test/CodeGen/lto-newpm-pipeline.c new file mode 100644 index 000000000000..10112da6d508 --- /dev/null +++ b/test/CodeGen/lto-newpm-pipeline.c @@ -0,0 +1,53 @@ +// REQUIRES: x86-registered-target + +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=full -O0 %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-FULL-O0 +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=thin -O0 %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-THIN-O0 +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=full -O1 %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-FULL-OPTIMIZED +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=thin -O1 %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-THIN-OPTIMIZED +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=full -O2 %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-FULL-OPTIMIZED +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=thin -O2 %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-THIN-OPTIMIZED +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=full -O3 %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-FULL-OPTIMIZED +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=thin -O3 %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-THIN-OPTIMIZED +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=full -Os %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-FULL-OPTIMIZED +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=thin -Os %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-THIN-OPTIMIZED +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=full -Oz %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-FULL-OPTIMIZED +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -fexperimental-new-pass-manager -fdebug-pass-manager -flto=thin -Oz %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-THIN-OPTIMIZED + +// CHECK-FULL-O0: Starting llvm::Module pass manager run. +// CHECK-FULL-O0: Running pass: AlwaysInlinerPass +// CHECK-FULL-O0-NEXT: Running pass: BitcodeWriterPass +// CHECK-FULL-O0: Finished llvm::Module pass manager run. + +// CHECK-THIN-O0: Starting llvm::Module pass manager run. +// CHECK-THIN-O0: Running pass: AlwaysInlinerPass +// CHECK-THIN-O0-NEXT: Running pass: NameAnonGlobalPass +// CHECK-THIN-O0-NEXT: Running pass: ThinLTOBitcodeWriterPass +// CHECK-THIN-O0: Finished llvm::Module pass manager run. + +// TODO: The LTO pre-link pipeline currently invokes +// buildPerModuleDefaultPipeline(), which contains LoopVectorizePass. +// This may change as the pipeline gets implemented. +// CHECK-FULL-OPTIMIZED: Starting llvm::Function pass manager run. +// CHECK-FULL-OPTIMIZED: Running pass: LoopVectorizePass +// CHECK-FULL-OPTIMIZED: Running pass: BitcodeWriterPass + +// The ThinLTO pre-link pipeline shouldn't contain passes like +// LoopVectorizePass. +// CHECK-THIN-OPTIMIZED: Starting llvm::Function pass manager run. +// CHECK-THIN-OPTIMIZED-NOT: Running pass: LoopVectorizePass +// CHECK-THIN-OPTIMIZED: Running pass: NameAnonGlobalPass +// CHECK-THIN-OPTIMIZED: Running pass: ThinLTOBitcodeWriterPass + +void Foo() {} diff --git a/test/CodeGen/mangle-ms.c b/test/CodeGen/mangle-ms.c index 0ad43d5e06c2..042c72e6d794 100644 --- a/test/CodeGen/mangle-ms.c +++ b/test/CodeGen/mangle-ms.c @@ -2,3 +2,12 @@ // CHECK: define void @"\01?f@@$$J0YAXP6AX@Z@Z" __attribute__((overloadable)) void f(void (*x)()) {} + +// CHECK: define void @f +void f(void (*x)(int)) {} + +// CHECK: define void @g +void g(void (*x)(int)) {} + +// CHECK: define void @"\01?g@@$$J0YAXP6AX@Z@Z" +__attribute__((overloadable)) void g(void (*x)()) {} diff --git a/test/CodeGen/mangle.c b/test/CodeGen/mangle.c index 46ef512f6950..f94139bc5e3c 100644 --- a/test/CodeGen/mangle.c +++ b/test/CodeGen/mangle.c @@ -9,6 +9,10 @@ void __attribute__((__overloadable__)) f0(int a) {} // CHECK: @_Z2f0l void __attribute__((__overloadable__)) f0(long b) {} +// Unless it's unmarked. +// CHECK: @f0 +void f0(float b) {} + // CHECK: @bar // These should get merged. diff --git a/test/CodeGen/named_reg_global.c b/test/CodeGen/named_reg_global.c index 1da625746891..232b74de1cab 100644 --- a/test/CodeGen/named_reg_global.c +++ b/test/CodeGen/named_reg_global.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-linux-gnu -S -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-X86-64 // RUN: %clang_cc1 -triple arm64-linux-gnu -S -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-ARM -// RUN: %clang_cc1 -triple armv7-linux-gnu -S -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-ARM +// RUN: %clang_cc1 -triple armv7-linux-gnu -target-abi apcs-gnu -S -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-ARM // CHECK-NOT: @sp = common global diff --git a/test/CodeGen/neon-immediate-ubsan.c b/test/CodeGen/neon-immediate-ubsan.c index c3e1ce23301d..aacf76a6338b 100644 --- a/test/CodeGen/neon-immediate-ubsan.c +++ b/test/CodeGen/neon-immediate-ubsan.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple armv7s-linux-gnu -emit-llvm -o - %s \ +// RUN: %clang_cc1 -triple armv7s-linux-gnu -target-abi apcs-gnu -emit-llvm -o - %s \ // RUN: -target-feature +neon -target-cpu cortex-a8 \ // RUN: -fsanitize=signed-integer-overflow \ // RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=ARMV7 diff --git a/test/CodeGen/pgo-sample-thinlto-summary.c b/test/CodeGen/pgo-sample-thinlto-summary.c index 7782aeb76616..51c8faa6be6d 100644 --- a/test/CodeGen/pgo-sample-thinlto-summary.c +++ b/test/CodeGen/pgo-sample-thinlto-summary.c @@ -1,5 +1,9 @@ -// RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample-thinlto-summary.prof %s -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=O2 +// RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample-thinlto-summary.prof %s -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=SAMPLEPGO // RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample-thinlto-summary.prof %s -emit-llvm -flto=thin -o - 2>&1 | FileCheck %s -check-prefix=THINLTO +// RUN: %clang_cc1 -O2 -fexperimental-new-pass-manager -fprofile-sample-use=%S/Inputs/pgo-sample-thinlto-summary.prof %s -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=SAMPLEPGO +// FIXME: Run the following command once LTOPreLinkDefaultPipeline is +// customized. +// %clang_cc1 -O2 -fexperimental-new-pass-manager -fprofile-sample-use=%S/Inputs/pgo-sample-thinlto-summary.prof %s -emit-llvm -flto=thin -o - 2>&1 | FileCheck %s -check-prefix=THINLTO // Checks if hot call is inlined by normal compile, but not inlined by // thinlto compile. @@ -11,9 +15,9 @@ void foo(int n) { g += baz(i); } -// O2-LABEL: define void @bar +// SAMPLEPGO-LABEL: define void @bar // THINLTO-LABEL: define void @bar -// O2-NOT: call{{.*}}foo +// SAMPLEPGO-NOT: call{{.*}}foo // THINLTO: call{{.*}}foo void bar(int n) { for (int i = 0; i < n; i++) @@ -21,10 +25,10 @@ void bar(int n) { } // Checks if loop unroll is invoked by normal compile, but not thinlto compile. -// O2-LABEL: define void @unroll +// SAMPLEPGO-LABEL: define void @unroll // THINLTO-LABEL: define void @unroll -// O2: call{{.*}}baz -// O2: call{{.*}}baz +// SAMPLEPGO: call{{.*}}baz +// SAMPLEPGO: call{{.*}}baz // THINLTO: call{{.*}}baz // THINLTO-NOT: call{{.*}}baz void unroll() { @@ -32,11 +36,13 @@ void unroll() { baz(i); } -// Check that icp is not invoked (both -O2 and ThinLTO). -// O2-LABEL: define void @icp +// Checks that icp is not invoked for ThinLTO, but invoked for normal samplepgo. +// SAMPLEPGO-LABEL: define void @icp // THINLTO-LABEL: define void @icp -// O2-NOT: if.true.direct_targ -// ThinLTO-NOT: if.true.direct_targ +// SAMPLEPGO: if.true.direct_targ +// FIXME: the following condition needs to be reversed once +// LTOPreLinkDefaultPipeline is customized. +// THINLTO-NOT: if.true.direct_targ void icp(void (*p)()) { p(); } diff --git a/test/CodeGen/xray-attributes-supported.cpp b/test/CodeGen/xray-attributes-supported.cpp index 860efb276f69..21a5dde53a05 100644 --- a/test/CodeGen/xray-attributes-supported.cpp +++ b/test/CodeGen/xray-attributes-supported.cpp @@ -1,5 +1,5 @@ // RUN: %clang_cc1 %s -fxray-instrument -std=c++11 -x c++ -emit-llvm -o - -triple x86_64-unknown-linux-gnu | FileCheck %s -// RUN: %clang_cc1 %s -fxray-instrument -std=c++11 -x c++ -emit-llvm -o - -triple arm-unknown-linux-gnu | FileCheck %s +// RUN: %clang_cc1 %s -fxray-instrument -std=c++11 -x c++ -emit-llvm -o - -triple arm-unknown-linux-gnu -target-abi apcs-gnu | FileCheck %s // RUN: %clang_cc1 %s -fxray-instrument -std=c++11 -x c++ -emit-llvm -o - -triple mips-unknown-linux-gnu | FileCheck %s // RUN: %clang_cc1 %s -fxray-instrument -std=c++11 -x c++ -emit-llvm -o - -triple mipsel-unknown-linux-gnu | FileCheck %s // RUN: %clang_cc1 %s -fxray-instrument -std=c++11 -x c++ -emit-llvm -o - -triple mips64-unknown-linux-gnu | FileCheck %s diff --git a/test/CodeGenCXX/dllexport-dtor-thunks.cpp b/test/CodeGenCXX/dllexport-dtor-thunks.cpp new file mode 100644 index 000000000000..52f9901620fa --- /dev/null +++ b/test/CodeGenCXX/dllexport-dtor-thunks.cpp @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -mconstructor-aliases -fms-extensions %s -emit-llvm -o - -triple x86_64-windows-msvc | FileCheck %s + +struct __declspec(dllexport) A { virtual ~A(); }; +struct __declspec(dllexport) B { virtual ~B(); }; +struct __declspec(dllexport) C : A, B { virtual ~C(); }; +C::~C() {} + +// This thunk should *not* be dllexport. +// CHECK: define linkonce_odr i8* @"\01??_EC@@W7EAAPEAXI@Z" +// CHECK: define dllexport void @"\01??1C@@UEAA@XZ" diff --git a/test/CodeGenCXX/mangle-ms.cpp b/test/CodeGenCXX/mangle-ms.cpp index ee0f50e5e2d3..7e2f17f27a96 100644 --- a/test/CodeGenCXX/mangle-ms.cpp +++ b/test/CodeGenCXX/mangle-ms.cpp @@ -399,6 +399,13 @@ template void fn_tmpl<extern_c_func>(); extern "C" void __attribute__((overloadable)) overloaded_fn() {} // CHECK-DAG: @"\01?overloaded_fn@@$$J0YAXXZ" +extern "C" void overloaded_fn2() {} +// CHECK-DAG: @overloaded_fn2 +// +extern "C" void __attribute__((overloadable)) overloaded_fn3(); +extern "C" void overloaded_fn3() {} +// CHECK-DAG: @overloaded_fn3 + namespace UnnamedType { struct S { typedef struct {} *T1[1]; diff --git a/test/CodeGenCXX/msabi-blocks.cpp b/test/CodeGenCXX/msabi-blocks.cpp new file mode 100644 index 000000000000..bee59d9ed535 --- /dev/null +++ b/test/CodeGenCXX/msabi-blocks.cpp @@ -0,0 +1,113 @@ +// RUN: %clang_cc1 -triple i686-unknown-windows-msvc -std=c++11 -fblocks -S -o - -emit-llvm %s | FileCheck %s -check-prefix CHECK-X86 +// RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -std=c++11 -fblocks -S -o - -emit-llvm %s | FileCheck %s -check-prefix CHECK-X64 + +extern int e(void); + +void (^b)() = ^{ + static int i = 0; +}; + +// CHECK-X86-DAG: @"\01?i@?1??_block_invoke@@YAXPAU__block_literal@@@Z@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"\01?i@?1??_block_invoke@@YAXPEAU__block_literal@@@Z@4HA" ={{.*}} global i32 0 + +void f(void) { + static int i = 0; + ^{ static int i = e(); }(); + +// CHECK-X86-DAG: @"\01?i@?1??_block_invoke_1@@YAXPAU__block_literal_1@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"\01?i@?1??_block_invoke_1@@YAXPEAU__block_literal_1@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 + + ^{ static int i = e(); }(); + +// CHECK-X86-DAG: @"\01?i@?1??_block_invoke_2@@YAXPAU__block_literal_2@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"\01?i@?1??_block_invoke_2@@YAXPEAU__block_literal_2@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 + + ^{ ^{ static int i = e(); }(); }(); + +// CHECK-X86-DAG: @"\01?i@?1??_block_invoke_3@@YAXPAU__block_literal_3@@@Z?1??_block_invoke_4@@YAXPAU__block_literal_4@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"\01?i@?1??_block_invoke_3@@YAXPEAU__block_literal_3@@@Z?1??_block_invoke_4@@YAXPEAU__block_literal_4@@@Z?1??f@@YAXXZ@4HA" ={{.*}} global i32 0 +} + + +template <typename> +void g(void) { + ^{ static int i = e(); }(); +} + +template void g<char>(void); + +// CHECK-X86-DAG: @"\01?i@?2??_block_invoke_1@@YAXPAU__block_literal_1@@@Z?2???$g@D@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"\01?i@?2??_block_invoke_1@@YAXPEAU__block_literal_1@@@Z?2???$g@D@@YAXXZ@4HA" ={{.*}} global i32 0 + +template void g<int>(void); + +// CHECK-X86-DAG: @"\01?i@?2??_block_invoke_1@@YAXPAU__block_literal_1@@@Z?2???$g@H@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"\01?i@?2??_block_invoke_1@@YAXPEAU__block_literal_1@@@Z?2???$g@H@@YAXXZ@4HA" ={{.*}} global i32 0 + +inline void h(void) { + ^{ static int i = e(); }(); +} + +// CHECK-X86-DAG: @"\01?i@?2??_block_invoke_1@@YAXPAU__block_literal_1@@@Z?2??h@@YAXXZ@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"\01?i@?2??_block_invoke_1@@YAXPEAU__block_literal_1@@@Z?2??h@@YAXXZ@4HA" ={{.*}} global i32 0 + +struct s { + int i = ^{ static int i = e(); return ++i; }(); + +// CHECK-X86-DAG: @"\01?i@?0??_block_invoke_1@0s@@YAXPAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"\01?i@?0??_block_invoke_1@0s@@YAXPEAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 + + int j = ^{ static int i = e(); return ++i; }(); + +// CHECK-X86-DAG: @"\01?i@?0??_block_invoke_1@j@s@@YAXPAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"\01?i@?0??_block_invoke_1@j@s@@YAXPEAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 + + void m(int i = ^{ static int i = e(); return ++i; }(), + int j = ^{ static int i = e(); return ++i; }()) {} + +// CHECK-X86-DAG: @"\01?i@?0??_block_invoke_1_1@@YAXPAU__block_literal_1_1@@@Z?0??m@s@@QAEXHH@Z@4HA" ={{.*}} global i32 0 +// CHECK-X86-DAG: @"\01?i@?0??_block_invoke_1_2@@YAXPAU__block_literal_1_2@@@Z?0??m@s@@QAEXHH@Z@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"\01?i@?0??_block_invoke_1_1@@YAXPEAU__block_literal_1_1@@@Z?0??m@s@@QEAAXHH@Z@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"\01?i@?0??_block_invoke_1_2@@YAXPEAU__block_literal_1_2@@@Z?0??m@s@@QEAAXHH@Z@4HA" ={{.*}} global i32 0 + + void n(int = ^{ static int i = e(); return ++i; }(), + int = ^{ static int i = e(); return ++i; }()) {} + +// CHECK-X86-DAG: @"\01?i@?0??_block_invoke_1_1@@YAXPAU__block_literal_1_1@@@Z?0??n@s@@QAEXHH@Z@4HA" ={{.*}} global i32 0 +// CHECK-X86-DAG: @"\01?i@?0??_block_invoke_1_2@@YAXPAU__block_literal_1_2@@@Z?0??n@s@@QAEXHH@Z@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"\01?i@?0??_block_invoke_1_1@@YAXPEAU__block_literal_1_1@@@Z?0??n@s@@QEAAXHH@Z@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"\01?i@?0??_block_invoke_1_2@@YAXPEAU__block_literal_1_2@@@Z?0??n@s@@QEAAXHH@Z@4HA" ={{.*}} global i32 0 + +}; + +struct t { + struct u { + int i = ^{ static int i = e(); return ++i; }(); + +// CHECK-X86-DAG: @"\01?i@?0??_block_invoke_1@0u@t@@YAXPAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 +// CHECK-X64-DAG: @"\01?i@?0??_block_invoke_1@0u@t@@YAXPEAU__block_literal_1@@@Z@4HA" ={{.*}} global i32 0 + + }; +}; + +void j(void) { + h(); + struct s s; + s.m(); + s.n(); + struct t::u t; +} + +#if 0 +template <typename T> +struct v { + static T i; +}; + +template <typename T> +T v<T>::i = ^{ static T i = T(); return i; }(); + +template class v<char>; +template class v<int>; +#endif + diff --git a/test/CodeGenObjC/ivar-type-encoding.m b/test/CodeGenObjC/ivar-type-encoding.m index ffa5e0d7af0d..2fd962cf07bb 100644 --- a/test/CodeGenObjC/ivar-type-encoding.m +++ b/test/CodeGenObjC/ivar-type-encoding.m @@ -33,3 +33,19 @@ int main() { // CHECK: @1 = private unnamed_addr constant [12 x i8] c"@\22NSString\22\00" // CHECK: @2 = private unnamed_addr constant [9 x i8] c"_intIvar\00" // CHECK: @3 = private unnamed_addr constant [2 x i8] c"i\00" + +@interface Class1 { + int : 3; + short : 2; + long long ll; + char : 1; +} +@end + +@implementation Class1 +@end + +// CHECK: @{{.*}} = private unnamed_addr constant [5 x i8] c"b0i3\00" +// CHECK: @{{.*}} = private unnamed_addr constant [5 x i8] c"b3s2\00" +// CHECK: @{{.*}} = private unnamed_addr constant [2 x i8] c"q\00" +// CHECK: @{{.*}} = private unnamed_addr constant [{{7|6}} x i8] c"b{{128|96}}c1\00" diff --git a/test/CodeGenObjC/parameterized_classes.m b/test/CodeGenObjC/parameterized_classes.m index 8fe5c52b8d39..34aca35af313 100644 --- a/test/CodeGenObjC/parameterized_classes.m +++ b/test/CodeGenObjC/parameterized_classes.m @@ -96,3 +96,31 @@ void blockTest(NSMutableArray<void (^)(void)> *array, NSString *name) { _destination = a; } @end + +// CHECK-LABEL: define internal void @"\01-[C0 foo1]"( +// CHECK: {{.*}} = alloca +// CHECK: {{.*}} = alloca +// CHECK: %[[D:.*]] = alloca %[[TY:.*]]* +// CHECK: %[[TEMP:.*]] = alloca %[[TY]]* +// CHECK: %[[V4:.*]] = load %[[TY]]*, %[[TY]]** %[[D]] +// CHECK: store %[[TY]]* %[[V4]], %[[TY]]** %[[TEMP]] +// CHECK: %[[V7:.*]] = bitcast %[[TY]]** %[[TEMP]] to i8** +// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i8**)*)(i8* %{{.*}}, i8* %{{.*}}, i8** %[[V7]]) + +@interface P0<ObjectType> : NSObject +- (void)m0:(ObjectType *)first; +@end + +@interface C0 : NSObject +-(void)foo1; +@end + +@implementation C0 { + P0<NSString *> *x; +} + +-(void)foo1 { + NSString *d; + [x m0:&d]; +} +@end diff --git a/test/CodeGenObjC/protocol-comdat.m b/test/CodeGenObjC/protocol-comdat.m index 65e1b9fa2c82..a19ba8cf35dc 100644 --- a/test/CodeGenObjC/protocol-comdat.m +++ b/test/CodeGenObjC/protocol-comdat.m @@ -4,6 +4,9 @@ - (void) method; @end +@protocol Q; +@protocol R; + @interface I<P> @end @@ -11,9 +14,14 @@ - (void) method { } @end +_Bool f(void) { + return @protocol(Q) == @protocol(R); +} // CHECK: $"\01l_OBJC_PROTOCOL_$_P" = comdat any // CHECK: $"\01l_OBJC_LABEL_PROTOCOL_$_P" = comdat any +// CHECK: $"\01l_OBJC_PROTOCOL_REFERENCE_$_Q" = comdat any +// CHECK: $"\01l_OBJC_PROTOCOL_REFERENCE_$_R" = comdat any // CHECK: @"\01l_OBJC_PROTOCOL_$_P" = {{.*}}, comdat // CHECK: @"\01l_OBJC_LABEL_PROTOCOL_$_P" = {{.*}}, comdat diff --git a/test/CodeGenObjC/stret-1.m b/test/CodeGenObjC/stret-1.m index a7bcdda48b14..2314d5a9ecf5 100644 --- a/test/CodeGenObjC/stret-1.m +++ b/test/CodeGenObjC/stret-1.m @@ -12,11 +12,20 @@ struct stret one = {{1}}; int main(int argc, const char **argv) { - [(id)(argc&~255) method]; + struct stret s; + s = [(id)(argc&~255) method]; // CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (%struct.stret*, i8*, i8*)*)(%struct.stret* sret [[T0:%[^,]+]] // CHECK: [[T0P:%.*]] = bitcast %struct.stret* [[T0]] to i8* // CHECK: call void @llvm.memset.p0i8.i64(i8* [[T0P]], i8 0, i64 400, i32 4, i1 false) + s = [Test method]; + // CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (%struct.stret*, i8*, i8*)*)(%struct.stret* sret [[T1:%[^,]+]] + // CHECK-NOT: call void @llvm.memset.p0i8.i64( + + [(id)(argc&~255) method]; + // CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (%struct.stret*, i8*, i8*)*)(%struct.stret* sret [[T1:%[^,]+]] + // CHECK-NOT: call void @llvm.memset.p0i8.i64( + [Test method]; // CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (%struct.stret*, i8*, i8*)*)(%struct.stret* sret [[T1:%[^,]+]] // CHECK-NOT: call void @llvm.memset.p0i8.i64( diff --git a/test/CodeGenObjC/stret-lifetime.m b/test/CodeGenObjC/stret-lifetime.m new file mode 100644 index 000000000000..d81ef34aeed4 --- /dev/null +++ b/test/CodeGenObjC/stret-lifetime.m @@ -0,0 +1,34 @@ +// RUN: %clang_cc1 -triple arm64-apple-darwin -S -emit-llvm -o - -O2 -disable-llvm-passes %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -S -emit-llvm -o - -O2 -disable-llvm-passes %s | FileCheck %s +// RUN: %clang_cc1 -triple arm64-apple-darwin -fobjc-arc -S -emit-llvm -o - -O2 -disable-llvm-passes %s | FileCheck %s --check-prefixes=CHECK,ARC +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-arc -S -emit-llvm -o - -O2 -disable-llvm-passes %s | FileCheck %s --check-prefixes=CHECK,ARC + +struct stret { int x[100]; }; +struct stret one = {{1}}; + +@interface Test ++(struct stret) method; ++(struct stret) methodConsuming:(id __attribute__((ns_consumed)))consumed; +@end + +void foo(id o, id p) { + [o method]; + // CHECK: @llvm.lifetime.start + // CHECK: call void bitcast {{.*}} @objc_msgSend + // CHECK: @llvm.lifetime.end + // CHECK-NOT: call void @llvm.memset + + [o methodConsuming:p]; + // ARC: [[T0:%.*]] = icmp eq i8* + // ARC: br i1 [[T0]] + + // CHECK: @llvm.lifetime.start + // CHECK: call void bitcast {{.*}} @objc_msgSend + // CHECK: @llvm.lifetime.end + // ARC: br label + + // ARC: call void @objc_release + // ARC: br label + + // CHECK-NOT: call void @llvm.memset +} diff --git a/test/CodeGenObjCXX/arc-indirect.mm b/test/CodeGenObjCXX/arc-indirect.mm new file mode 100644 index 000000000000..6982bac04118 --- /dev/null +++ b/test/CodeGenObjCXX/arc-indirect.mm @@ -0,0 +1,22 @@ +// RUN: %clang_cc1 -std=c++11 -triple i686-unknown-windows-msvc -fobjc-runtime=gnustep -fobjc-arc -Wno-objc-root-class -emit-llvm -o - %s | FileCheck -check-prefixes CHECK,CHECK-GNUSTEP %s +// RUN: %clang_cc1 -std=c++11 -triple i686-unknown-windows-msvc -fobjc-runtime=macosx -fobjc-arc -Wno-objc-root-class -emit-llvm -o - %s | FileCheck -check-prefixes CHECK,CHECK-DARWIN %s +// RUN: %clang_cc1 -std=c++11 -triple i686-unknown-windows-msvc -fobjc-runtime=ios -fobjc-arc -Wno-objc-root-class -emit-llvm -o - %s | FileCheck -check-prefixes CHECK,CHECK-DARWIN %s + +// non trivially copyable, forces inalloca +struct S { + S(const S &s) {} +}; + +@interface C +@end + +@implementation C +- (void)object:(id)obj struct:(S)s { +} +@end + +// CHECK-GNUSTEP: define internal void @_i_C__object_struct_(<{ %0*, i8*, i8*, %struct.S, [3 x i8] }>* inalloca) +// CHECK-DARWIN: define internal void @"\01-[C object:struct:]"(<{ %0*, i8*, i8*, %struct.S, [3 x i8] }>* inalloca) +// CHECK: %obj = getelementptr inbounds <{ %0*, i8*, i8*, %struct.S, [3 x i8] }>, <{ %0*, i8*, i8*, %struct.S, [3 x i8] }>* %0, i32 0, i32 2 +// CHECK: %[[INSTANCE:[0-9]+]] = load i8*, i8** %obj, align 4 +// CHECK: call void @objc_storeStrong(i8** %obj, i8* %[[INSTANCE]]) diff --git a/test/CodeGenOpenCL/addr-space-struct-arg.cl b/test/CodeGenOpenCL/addr-space-struct-arg.cl index d711f78d4ef0..6ea0aff0a074 100644 --- a/test/CodeGenOpenCL/addr-space-struct-arg.cl +++ b/test/CodeGenOpenCL/addr-space-struct-arg.cl @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - -O0 -ffake-address-space-map -triple i686-pc-darwin | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -o - -O0 -finclude-default-header -ffake-address-space-map -triple i686-pc-darwin | FileCheck -check-prefixes=COM,X86 %s +// RUN: %clang_cc1 %s -emit-llvm -o - -O0 -finclude-default-header -triple amdgcn-amdhsa-amd-amdgizcl | FileCheck -check-prefixes=COM,AMD %s typedef struct { int cells[9]; @@ -8,16 +9,57 @@ typedef struct { int cells[16]; } Mat4X4; +struct StructOneMember { + int2 x; +}; + +struct StructTwoMember { + int2 x; + int2 y; +}; + +// COM-LABEL: define void @foo Mat4X4 __attribute__((noinline)) foo(Mat3X3 in) { Mat4X4 out; return out; } +// COM-LABEL: define {{.*}} void @ker +// Expect two mem copies: one for the argument "in", and one for +// the return value. +// X86: call void @llvm.memcpy.p0i8.p1i8.i32(i8* +// X86: call void @llvm.memcpy.p1i8.p0i8.i32(i8 addrspace(1)* +// AMD: call void @llvm.memcpy.p5i8.p1i8.i64(i8 addrspace(5)* +// AMD: call void @llvm.memcpy.p1i8.p5i8.i64(i8 addrspace(1)* kernel void ker(global Mat3X3 *in, global Mat4X4 *out) { out[0] = foo(in[1]); } -// Expect two mem copies: one for the argument "in", and one for -// the return value. -// CHECK: call void @llvm.memcpy.p0i8.p1i8.i32(i8* -// CHECK: call void @llvm.memcpy.p1i8.p0i8.i32(i8 addrspace(1)* +// AMD-LABEL: define void @FuncOneMember(%struct.StructOneMember addrspace(5)* byval align 8 %u) +void FuncOneMember(struct StructOneMember u) { + u.x = (int2)(0, 0); +} + +// AMD-LABEL: define amdgpu_kernel void @KernelOneMember +// AMD-SAME: (<2 x i32> %[[u_coerce:.*]]) +// AMD: %[[u:.*]] = alloca %struct.StructOneMember, align 8, addrspace(5) +// AMD: %[[coerce_dive:.*]] = getelementptr inbounds %struct.StructOneMember, %struct.StructOneMember addrspace(5)* %[[u]], i32 0, i32 0 +// AMD: store <2 x i32> %[[u_coerce]], <2 x i32> addrspace(5)* %[[coerce_dive]] +// AMD: call void @FuncOneMember(%struct.StructOneMember addrspace(5)* byval align 8 %[[u]]) +kernel void KernelOneMember(struct StructOneMember u) { + FuncOneMember(u); +} + +// AMD-LABEL: define void @FuncTwoMember(%struct.StructTwoMember addrspace(5)* byval align 8 %u) +void FuncTwoMember(struct StructTwoMember u) { + u.x = (int2)(0, 0); +} + +// AMD-LABEL: define amdgpu_kernel void @KernelTwoMember +// AMD-SAME: (%struct.StructTwoMember %[[u_coerce:.*]]) +// AMD: %[[u:.*]] = alloca %struct.StructTwoMember, align 8, addrspace(5) +// AMD: store %struct.StructTwoMember %[[u_coerce]], %struct.StructTwoMember addrspace(5)* %[[u]] +// AMD: call void @FuncTwoMember(%struct.StructTwoMember addrspace(5)* byval align 8 %[[u]]) +kernel void KernelTwoMember(struct StructTwoMember u) { + FuncTwoMember(u); +} diff --git a/test/Driver/arm-execute-only.c b/test/Driver/arm-execute-only.c index a4854485e1e4..c226a7f3b4b1 100644 --- a/test/Driver/arm-execute-only.c +++ b/test/Driver/arm-execute-only.c @@ -1,39 +1,3 @@ -// RUN: %clang -target armv6t2-eabi -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv6t2-eabi -### -mexecute-only %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY - -// RUN: %clang -target armv6t2-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv7m-eabi -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv7m-eabi -### -mexecute-only %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY - -// RUN: %clang -target armv7m-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv8m.base-eabi -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv8m.base-eabi -### -mexecute-only %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY - -// RUN: %clang -target armv8m.base-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv8m.main-eabi -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv8m.main-eabi -### -mexecute-only %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY - -// RUN: %clang -target armv8m.main-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - // RUN: not %clang -c -target thumbv6m-eabi -mexecute-only %s 2>&1 | \ // RUN: FileCheck --check-prefix CHECK-EXECUTE-ONLY-NOT-SUPPORTED %s @@ -45,42 +9,6 @@ // -mpure-code flag for GCC compatibility -// RUN: %clang -target armv6t2-eabi -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv6t2-eabi -### -mpure-code %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY - -// RUN: %clang -target armv6t2-eabi -### -mpure-code -mno-pure-code %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv7m-eabi -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv7m-eabi -### -mpure-code %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY - -// RUN: %clang -target armv7m-eabi -### -mpure-code -mno-pure-code %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv8m.base-eabi -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv8m.base-eabi -### -mpure-code %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY - -// RUN: %clang -target armv8m.base-eabi -### -mpure-code -mno-pure-code %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv8m.main-eabi -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv8m.main-eabi -### -mpure-code %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY - -// RUN: %clang -target armv8m.main-eabi -### -mpure-code -mno-pure-code %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - // RUN: not %clang -c -target thumbv6m-eabi -mpure-code %s 2>&1 | \ // RUN: FileCheck --check-prefix CHECK-EXECUTE-ONLY-NOT-SUPPORTED %s diff --git a/test/Driver/clang_f_opts.c b/test/Driver/clang_f_opts.c index bad49942a4c4..e4b72d69ca3f 100644 --- a/test/Driver/clang_f_opts.c +++ b/test/Driver/clang_f_opts.c @@ -178,13 +178,6 @@ // CHECK-SLP-VECTORIZE: "-vectorize-slp" // CHECK-NO-SLP-VECTORIZE-NOT: "-vectorize-slp" -// RUN: %clang -### -S -fslp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE-AGG %s -// RUN: %clang -### -S -fno-slp-vectorize-aggressive -fslp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE-AGG %s -// RUN: %clang -### -S -fno-slp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE-AGG %s -// RUN: %clang -### -S -fslp-vectorize-aggressive -fno-slp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE-AGG %s -// CHECK-SLP-VECTORIZE-AGG: "-vectorize-slp-aggressive" -// CHECK-NO-SLP-VECTORIZE-AGG-NOT: "-vectorize-slp-aggressive" - // RUN: %clang -### -S -fextended-identifiers %s 2>&1 | FileCheck -check-prefix=CHECK-EXTENDED-IDENTIFIERS %s // RUN: not %clang -### -S -fno-extended-identifiers %s 2>&1 | FileCheck -check-prefix=CHECK-NO-EXTENDED-IDENTIFIERS %s // CHECK-EXTENDED-IDENTIFIERS: "-cc1" diff --git a/test/Driver/darwin-version.c b/test/Driver/darwin-version.c index 8f08bb9dec4a..c11a2df37f98 100644 --- a/test/Driver/darwin-version.c +++ b/test/Driver/darwin-version.c @@ -10,6 +10,41 @@ // RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=3.0 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS3 %s // CHECK-VERSION-IOS3: "armv6k-apple-ios3.0.0" + +// RUN: env IPHONEOS_DEPLOYMENT_TARGET=11.0 \ +// RUN: %clang -target armv7-apple-ios9.0 -c -### %s 2> %t.err +// RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-VERSION-IOS4 %s +// CHECK-VERSION-IOS4: invalid iOS deployment version 'IPHONEOS_DEPLOYMENT_TARGET=11.0' + +// RUN: %clang -target armv7-apple-ios9.0 -miphoneos-version-min=11.0 -c -### %s 2> %t.err +// RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-VERSION-IOS5 %s +// CHECK-VERSION-IOS5: invalid iOS deployment version '-miphoneos-version-min=11.0' + +// RUN: %clang -target i386-apple-darwin -mios-simulator-version-min=11.0 -c -### %s 2> %t.err +// RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-VERSION-IOS6 %s +// CHECK-VERSION-IOS6: invalid iOS deployment version '-mios-simulator-version-min=11.0' + +// RUN: %clang -target armv7-apple-ios11.1 -c -### %s 2>&1 | \ +// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS7 %s +// CHECK-VERSION-IOS7: thumbv7-apple-ios10.99.99 + +// RUN: env IPHONEOS_DEPLOYMENT_TARGET=11.0 \ +// RUN: %clang -target arm64-apple-ios11.0 -c -### %s 2>&1 | \ +// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS8 %s +// CHECK-VERSION-IOS8: arm64-apple-ios11.0.0 + +// RUN: %clang -target arm64-apple-ios11.0 -miphoneos-version-min=11.0 -c -### %s 2>&1 | \ +// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS9 %s +// CHECK-VERSION-IOS9: arm64-apple-ios11.0.0 + +// RUN: %clang -target x86_64-apple-darwin -mios-simulator-version-min=11.0 -c -### %s 2>&1 | \ +// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS10 %s +// CHECK-VERSION-IOS10: x86_64-apple-ios11.0.0 + +// RUN: %clang -target arm64-apple-ios11.1 -c -### %s 2>&1 | \ +// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS11 %s +// CHECK-VERSION-IOS11: arm64-apple-ios11.1.0 + // RUN: %clang -target i686-apple-darwin8 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-OSX4 %s // RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.4 -c %s -### 2>&1 | \ diff --git a/test/Driver/fuzzer.c b/test/Driver/fuzzer.c index e534a73a647f..989b3b9f6348 100644 --- a/test/Driver/fuzzer.c +++ b/test/Driver/fuzzer.c @@ -15,6 +15,14 @@ // // CHECK-LIBCXX-DARWIN: -lc++ + +// Check that we don't link in libFuzzer.a when producing a shared object. +// RUN: %clang -fsanitize=fuzzer %s -shared -o %t.so -### 2>&1 | FileCheck --check-prefixes=CHECK-NOLIB-SO %s +// CHECK-NOLIB-SO-NOT: libLLVMFuzzer.a + +// RUN: %clang -fsanitize=fuzzer -fsanitize-coverage=trace-pc %s -### 2>&1 | FileCheck --check-prefixes=CHECK-MSG %s +// CHECK-MSG-NOT: argument unused during compilation + int LLVMFuzzerTestOneInput(const char *Data, long Size) { return 0; } diff --git a/test/Driver/nios2-cpu.c b/test/Driver/nios2-cpu.c new file mode 100644 index 000000000000..d98f0384a66d --- /dev/null +++ b/test/Driver/nios2-cpu.c @@ -0,0 +1,26 @@ +// RUN: %clang -target nios2--- %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck %s + +// RUN: %clang -target nios2--- -mcpu=r1 %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-R1 %s +// RUN: %clang -target nios2--- -mcpu=nios2r1 %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-R1 %s +// RUN: %clang -target nios2--- -march=r1 %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-R1 %s +// RUN: %clang -target nios2--- -march=nios2r1 %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-R1 %s + +// RUN: %clang -target nios2--- -mcpu=r2 %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-R2 %s +// RUN: %clang -target nios2--- -mcpu=nios2r2 %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-R2 %s +// RUN: %clang -target nios2--- -march=r2 %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-R2 %s +// RUN: %clang -target nios2--- -march=nios2r2 %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-R2 %s + +// CHECK: "-triple" "nios2---" +// CHECK-R1: "-triple" "nios2---" +// CHECK-R1: "-target-cpu" "nios2r1" +// CHECK-R2: "-triple" "nios2---" +// CHECK-R2: "-target-cpu" "nios2r2" diff --git a/test/Driver/openmp-offload.c b/test/Driver/openmp-offload.c index 39eb41e6ac08..d43aa331c9dc 100644 --- a/test/Driver/openmp-offload.c +++ b/test/Driver/openmp-offload.c @@ -250,15 +250,15 @@ // // Compile for the powerpc device. // -// CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-emit-obj" {{.*}}"-pic-level" "2" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-pic-level" "2" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-SAME: [[T1OBJ:[^\\/]+\.o]]" "-x" "c" "{{.*}}[[INPUT]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" // CHK-COMMANDS: ld{{(\.exe)?}}" {{.*}}"-o" " // CHK-COMMANDS-SAME: [[T1BIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[T1OBJ]]" -// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[T1PP:[^\\/]+\.i]]" "-x" "c" "{{.*}}[[INPUT]]" -// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-emit-llvm-bc" {{.*}}"-pic-level" "2" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-pic-level" "2" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[T1BC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[T1PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[T1ASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[T1BC]]" // CHK-COMMANDS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-ibm-linux-gnu" "-filetype" "obj" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[T1OBJ:[^\\/]+\.o]]" "{{.*}}[[T1ASM]]" @@ -267,15 +267,15 @@ // // Compile for the x86 device. // -// CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-emit-obj" {{.*}}"-pic-level" "2" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-pic-level" "2" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-SAME: [[T2OBJ:[^\\/]+\.o]]" "-x" "c" "{{.*}}[[INPUT]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" // CHK-COMMANDS: ld{{(\.exe)?}}" {{.*}}"-o" " // CHK-COMMANDS-SAME: [[T2BIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[T2OBJ]]" -// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[T2PP:[^\\/]+\.i]]" "-x" "c" "{{.*}}[[INPUT]]" -// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-emit-llvm-bc" {{.*}}"-pic-level" "2" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-pic-level" "2" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[T2BC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[T2PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[T2ASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[T2BC]]" // CHK-COMMANDS-ST: clang{{.*}}" "-cc1as" "-triple" "x86_64-pc-linux-gnu" "-filetype" "obj" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[T2OBJ:[^\\/]+\.o]]" "{{.*}}[[T2ASM]]" @@ -398,25 +398,25 @@ // CHK-BUJOBS-ST-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[HOSTPP]]" "-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" // Create target 1 object. -// CHK-BUJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-SAME: [[T1OBJ:[^\\/]+\.o]]" "-x" "c" "{{.*}}[[INPUT]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[T1PP:[^\\/]+\.i]]" "-x" "c" "{{.*}}[[INPUT]]" -// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[T1BC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[T1PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[T1ASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[T1BC]]" // CHK-BUJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-ibm-linux-gnu" "-filetype" "obj" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[T1OBJ:[^\\/]+\.o]]" "{{.*}}[[T1ASM]]" // Create target 2 object. -// CHK-BUJOBS: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-SAME: [[T2OBJ:[^\\/]+\.o]]" "-x" "c" "{{.*}}[[INPUT]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-E" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[T2PP:[^\\/]+\.i]]" "-x" "c" "{{.*}}[[INPUT]]" -// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[T2BC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[T2PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-BUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[T2ASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[T2BC]]" // CHK-BUJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "x86_64-pc-linux-gnu" "-filetype" "obj" {{.*}}"-o" " // CHK-BUJOBS-ST-SAME: [[T2OBJ:[^\\/]+\.o]]" "{{.*}}[[T2ASM]]" @@ -464,13 +464,13 @@ // CHK-UBJOBS-ST-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[HOSTPP]]" "-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" // Create target 1 object. -// CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBJOBS-SAME: [[T1OBJ:[^\\/]+\.o]]" "-x" "cpp-output" "{{.*}}[[T1PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" // CHK-UBJOBS: ld{{(\.exe)?}}" {{.*}}"-o" " // CHK-UBJOBS-SAME: [[T1BIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[T1OBJ]]" -// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[T1BC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[T1PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[T1ASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[T1BC]]" // CHK-UBJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-ibm-linux-gnu" "-filetype" "obj" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[T1OBJ:[^\\/]+\.o]]" "{{.*}}[[T1ASM]]" @@ -478,13 +478,13 @@ // CHK-UBJOBS-ST-SAME: [[T1BIN:[^\\/]+\.out-openmp-powerpc64le-ibm-linux-gnu]]" {{.*}}"{{.*}}[[T1OBJ]]" // Create target 2 object. -// CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBJOBS-SAME: [[T2OBJ:[^\\/]+\.o]]" "-x" "cpp-output" "{{.*}}[[T2PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" // CHK-UBJOBS: ld{{(\.exe)?}}" {{.*}}"-o" " // CHK-UBJOBS-SAME: [[T2BIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[T2OBJ]]" -// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[T2BC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[T2PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[T2ASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[T2BC]]" // CHK-UBJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "x86_64-pc-linux-gnu" "-filetype" "obj" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[T2OBJ:[^\\/]+\.o]]" "{{.*}}[[T2ASM]]" @@ -559,21 +559,21 @@ // CHK-UBUJOBS-ST-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[HOSTPP]]" "-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" // Create target 1 object. -// CHK-UBUJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBUJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBUJOBS-SAME: [[T1OBJ:[^\\/]+\.o]]" "-x" "cpp-output" "{{.*}}[[T1PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBUJOBS-ST-SAME: [[T1BC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[T1PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBUJOBS-ST-SAME: [[T1ASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[T1BC]]" // CHK-UBUJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-ibm-linux-gnu" "-filetype" "obj" {{.*}}"-o" " // CHK-UBUJOBS-ST-SAME: [[T1OBJ:[^\\/]+\.o]]" "{{.*}}[[T1ASM]]" // Create target 2 object. -// CHK-UBUJOBS: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBUJOBS: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBUJOBS-SAME: [[T2OBJ:[^\\/]+\.o]]" "-x" "cpp-output" "{{.*}}[[T2PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBUJOBS-ST-SAME: [[T2BC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[T2PP]]" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" -// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBUJOBS-ST: clang{{.*}}" "-cc1" "-triple" "x86_64-pc-linux-gnu" "-aux-triple" "powerpc64le--linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-UBUJOBS-ST-SAME: [[T2ASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[T2BC]]" // CHK-UBUJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "x86_64-pc-linux-gnu" "-filetype" "obj" {{.*}}"-o" " // CHK-UBUJOBS-ST-SAME: [[T2OBJ:[^\\/]+\.o]]" "{{.*}}[[T2ASM]]" @@ -589,3 +589,11 @@ // CHK-UBUJOBS-ST-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "{{.*}}[[HOSTASM]]" // CHK-UBUJOBS-ST: clang-offload-bundler{{.*}}" "-type=o" "-targets=openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu,host-powerpc64le--linux" "-outputs= // CHK-UBUJOBS-ST-SAME: [[RES:[^\\/]+\.o]]" "-inputs={{.*}}[[T1OBJ]],{{.*}}[[T2OBJ]],{{.*}}[[HOSTOBJ]]" + +/// ########################################################################### + +/// Check -fopenmp-is-device is passed when compiling for the device. +// RUN: %clang -### -no-canonical-prefixes -target powerpc64le-linux -fopenmp=libomp -fopenmp-targets=powerpc64le-ibm-linux-gnu %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHK-FOPENMP-IS-DEVICE %s + +// CHK-FOPENMP-IS-DEVICE: clang{{.*}} "-aux-triple" "powerpc64le--linux" {{.*}}.c" "-fopenmp-is-device" "-fopenmp-host-ir-file-path" diff --git a/test/Driver/unavailable_aligned_allocation.cpp b/test/Driver/unavailable_aligned_allocation.cpp new file mode 100644 index 000000000000..cd75c08165d7 --- /dev/null +++ b/test/Driver/unavailable_aligned_allocation.cpp @@ -0,0 +1,54 @@ +// RUN: %clang -target x86_64-apple-macosx10.12 -c -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=UNAVAILABLE +// +// RUN: %clang -target arm64-apple-ios10 -c -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=UNAVAILABLE +// +// RUN: %clang -target arm64-apple-tvos10 -c -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=UNAVAILABLE +// +// RUN: %clang -target thumbv7-apple-watchos3 -c -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=UNAVAILABLE +// +// RUN: %clang -target x86_64-apple-macosx10.13 -mios-simulator-version-min=10 \ +// RUN: -c -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=UNAVAILABLE +// +// RUN: %clang -target x86_64-apple-macosx10.13 -mtvos-simulator-version-min=10 \ +// RUN: -c -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=UNAVAILABLE +// +// RUN: %clang -target x86_64-apple-macosx10.13 -mwatchos-simulator-version-min=3 \ +// RUN: -c -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=UNAVAILABLE +// +// UNAVAILABLE: "-faligned-alloc-unavailable" + +// RUN: %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=AVAILABLE +// +// RUN: %clang -target arm64-apple-ios11 -c -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=AVAILABLE +// +// RUN: %clang -target arm64-apple-tvos11 -c -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=AVAILABLE +// +// RUN: %clang -target armv7k-apple-watchos4 -c -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=AVAILABLE +// +// RUN: %clang -target x86_64-unknown-linux-gnu -c -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=AVAILABLE +// +// RUN: %clang -target x86_64-apple-macosx10.12 -mios-simulator-version-min=11 \ +// RUN: -c -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=AVAILABLE +// +// RUN: %clang -target x86_64-apple-macosx10.12 -mtvos-simulator-version-min=11 \ +// RUN: -c -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=AVAILABLE +// +// RUN: %clang -target x86_64-apple-macosx10.12 -mwatchos-simulator-version-min=4 \ +// RUN: -c -### %s 2>&1 \ +// RUN: | FileCheck %s -check-prefix=AVAILABLE +// +// AVAILABLE-NOT: "-faligned-alloc-unavailable" diff --git a/test/Driver/windows-cross.c b/test/Driver/windows-cross.c index 90fefbadfea1..0e688f0a26e7 100644 --- a/test/Driver/windows-cross.c +++ b/test/Driver/windows-cross.c @@ -80,3 +80,8 @@ // CHECK-ISYSTEM-AFTER: "-internal-isystem" "Windows Kits{{[/\\]}}10{{[/\\]}}Include{{[/\\]}}10.0.10586.0{{[/\\]}}um" // CHECK-ISYSTEM-AFTER: "-internal-isystem" "Windows Kits{{[/\\]}}10{{[/\\]}}Include{{[/\\]}}10.0.10586.0{{[/\\]}}shared" +// RUN: %clang -### -target armv7-windows-itanium -nostdinc -isystem-after "Windows Kits/10/Include/10.0.10586.0/ucrt" -c %s -o /dev/null 2>&1 \ +// RUN: | FileCheck %s --check-prefix CHECK-NOSTDINC-ISYSTEM-AFTER +// CHECK-NOSTDINC-ISYSTEM-AFTER: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" +// CHECK-NOSTDINC-ISYSTEM-AFTER-NOT: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include" +// CHECK-NOSTDINC-ISYSTEM-AFTER: "-internal-isystem" "Windows Kits{{[/\\]}}10{{[/\\]}}Include{{[/\\]}}10.0.10586.0{{[/\\]}}ucrt" diff --git a/test/FixIt/fixit-format-darwin.m b/test/FixIt/fixit-format-darwin.m index 077cc0cf21bc..54d25d92c2b3 100644 --- a/test/FixIt/fixit-format-darwin.m +++ b/test/FixIt/fixit-format-darwin.m @@ -8,12 +8,15 @@ int printf(const char * restrict, ...); #if __LP64__ +typedef long CFIndex; typedef long NSInteger; typedef unsigned long NSUInteger; #else +typedef int CFIndex; typedef int NSInteger; typedef unsigned int NSUInteger; #endif +CFIndex getCFIndex(); NSInteger getNSInteger(); NSUInteger getNSUInteger(); @@ -74,3 +77,10 @@ void bug33447() { Outer2("test 9: %s %s", getNSInteger(), getNSInteger()); // CHECK: Outer2("test 9: %ld %ld", (long)getNSInteger(), (long)getNSInteger()); } + +void testCFIndex() { + printf("test 10: %s", getCFIndex()); + // CHECK: printf("test 10: %ld", (long)getCFIndex()); + printf("test 11: %s %s", getCFIndex(), getCFIndex()); + // CHECK: printf("test 11: %ld %ld", (long)getCFIndex(), (long)getCFIndex()); +} diff --git a/test/FixIt/format-darwin.m b/test/FixIt/format-darwin.m index 170bb09fb904..fcc81036fcf3 100644 --- a/test/FixIt/format-darwin.m +++ b/test/FixIt/format-darwin.m @@ -7,13 +7,14 @@ int printf(const char * restrict, ...); #if __LP64__ +typedef long CFIndex; typedef long NSInteger; typedef unsigned long NSUInteger; typedef int SInt32; typedef unsigned int UInt32; #else - +typedef int CFIndex; typedef int NSInteger; typedef unsigned int NSUInteger; typedef long SInt32; @@ -27,6 +28,7 @@ typedef enum NSIntegerEnum : NSInteger { EnumValueB } NSIntegerEnum; +CFIndex getCFIndex(); NSInteger getNSInteger(); NSUInteger getNSUInteger(); SInt32 getSInt32(); @@ -55,6 +57,11 @@ void testCorrectionInAllCases() { // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:11-[[@LINE-2]]:13}:"%ld" // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:16-[[@LINE-3]]:16}:"(long)" + + printf("%s", getCFIndex()); // expected-warning{{values of type 'CFIndex' should not be used as format arguments; add an explicit cast to 'long' instead}} + + // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:11-[[@LINE-2]]:13}:"%ld" + // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:16-[[@LINE-3]]:16}:"(long)" } @interface Foo { @@ -120,6 +127,11 @@ void testWarn() { // CHECK-64: fix-it:"{{.*}}":{[[@LINE-2]]:11-[[@LINE-2]]:13}:"%ld" // CHECK-64: fix-it:"{{.*}}":{[[@LINE-3]]:16-[[@LINE-3]]:16}:"(long)" + + printf("%d", getCFIndex()); // expected-warning{{values of type 'CFIndex' should not be used as format arguments; add an explicit cast to 'long' instead}} + + // CHECK-64: fix-it:"{{.*}}":{[[@LINE-2]]:11-[[@LINE-2]]:13}:"%ld" + // CHECK-64: fix-it:"{{.*}}":{[[@LINE-3]]:16-[[@LINE-3]]:16}:"(long)" } void testPreserveHex() { @@ -167,6 +179,10 @@ void testWarn() { printf("%ld", getNSIntegerEnum()); // expected-warning{{enum values with underlying type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}} // CHECK-32: fix-it:"{{.*}}":{[[@LINE-2]]:17-[[@LINE-2]]:17}:"(long)" + + printf("%ld", getCFIndex()); // expected-warning{{values of type 'CFIndex' should not be used as format arguments; add an explicit cast to 'long' instead}} + + // CHECK-32: fix-it:"{{.*}}":{[[@LINE-2]]:17-[[@LINE-2]]:17}:"(long)" } void testPreserveHex() { @@ -218,6 +234,11 @@ void testCasts() { // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:11-[[@LINE-2]]:13}:"%ld" // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:16-[[@LINE-3]]:31}:"(long)" + + printf("%s", (CFIndex)0); // expected-warning{{values of type 'CFIndex' should not be used as format arguments; add an explicit cast to 'long' instead}} + + // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:11-[[@LINE-2]]:13}:"%ld" + // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:16-[[@LINE-3]]:25}:"(long)" } void testCapitals() { diff --git a/test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext b/test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext index aeea583de4d4..730dc4a0d5b1 100644 --- a/test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext +++ b/test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext @@ -1,7 +1,7 @@ foo:0:0 0: 0 bar:29:29 - 6: foo:0 + 9: foo:0 main:0:0 0: 0 bar:0 diff --git a/test/Frontend/optimization-remark-with-hotness.c b/test/Frontend/optimization-remark-with-hotness.c index 30ead64b8eb5..875fc75ae159 100644 --- a/test/Frontend/optimization-remark-with-hotness.c +++ b/test/Frontend/optimization-remark-with-hotness.c @@ -15,12 +15,14 @@ // RUN: optimization-remark-with-hotness.c %s -emit-llvm-only \ // RUN: -fprofile-sample-use=%t-sample.profdata -Rpass=inline \ // RUN: -Rpass-analysis=inline -Rpass-missed=inline \ -// RUN: -fdiagnostics-show-hotness -verify +// RUN: -fdiagnostics-show-hotness -fdiagnostics-hotness-threshold=10 \ +// RUN: -verify // The clang version of the previous test. // RUN: %clang -target x86_64-apple-macosx10.9 %s -c -emit-llvm -o /dev/null \ // RUN: -fprofile-instr-use=%t.profdata -Rpass=inline \ // RUN: -Rpass-analysis=inline -Rpass-missed=inline \ -// RUN: -fdiagnostics-show-hotness -Xclang -verify +// RUN: -fdiagnostics-show-hotness -fdiagnostics-hotness-threshold=10 \ +// RUN: -Xclang -verify // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name \ // RUN: optimization-remark-with-hotness.c %s -emit-llvm-only \ // RUN: -fprofile-instrument-use-path=%t.profdata -Rpass=inline \ @@ -28,11 +30,18 @@ // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name \ // RUN: optimization-remark-with-hotness.c %s -emit-llvm-only \ // RUN: -fprofile-instrument-use-path=%t.profdata -Rpass=inline \ -// RUN: -Rpass-analysis=inline -Rno-pass-with-hotness 2>&1 | FileCheck \ +// RUN: -Rpass-analysis=inline -Rno-pass-with-hotness 2>&1 | FileCheck \ // RUN: -check-prefix=HOTNESS_OFF %s // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name \ // RUN: optimization-remark-with-hotness.c %s -emit-llvm-only \ -// RUN: -Rpass=inline -Rpass-analysis=inline -fdiagnostics-show-hotness 2>&1 \ +// RUN: -fprofile-instrument-use-path=%t.profdata -Rpass=inline \ +// RUN: -Rpass-analysis=inline -fdiagnostics-show-hotness \ +// RUN: -fdiagnostics-hotness-threshold=100 2>&1 \ +// RUN: | FileCheck -allow-empty -check-prefix=THRESHOLD %s +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name \ +// RUN: optimization-remark-with-hotness.c %s -emit-llvm-only \ +// RUN: -Rpass=inline -Rpass-analysis=inline \ +// RUN: -fdiagnostics-show-hotness -fdiagnostics-hotness-threshold=10 2>&1 \ // RUN: | FileCheck -check-prefix=NO_PGO %s int foo(int x, int y) __attribute__((always_inline)); @@ -43,7 +52,10 @@ int sum = 0; void bar(int x) { // HOTNESS_OFF: foo inlined into bar // HOTNESS_OFF-NOT: hotness: + // THRESHOLD-NOT: inlined + // THRESHOLD-NOT: hotness // NO_PGO: '-fdiagnostics-show-hotness' requires profile-guided optimization information + // NO_PGO: '-fdiagnostics-hotness-threshold=' requires profile-guided optimization information // expected-remark@+2 {{foo should always be inlined (cost=always) (hotness: 30)}} // expected-remark@+1 {{foo inlined into bar (hotness: 30)}} sum += foo(x, x - 2); diff --git a/test/Index/ctor-init-source-loc.cpp b/test/Index/ctor-init-source-loc.cpp new file mode 100644 index 000000000000..ff93e58092da --- /dev/null +++ b/test/Index/ctor-init-source-loc.cpp @@ -0,0 +1,117 @@ +// RUN: c-index-test -test-load-source all %s -fno-delayed-template-parsing | FileCheck %s +template<typename MyBase> +struct Derived: MyBase::InnerIterator +{ + Derived() : MyBase::InnerIterator() {} +// CHECK: TypeRef=MyBase:2:19 Extent=[5:17 - 5:23] +}; + +template<typename MyBase> +struct Derived2: MyBase::Deeper::InnerIterator +{ + Derived2() : MyBase::Deeper::InnerIterator() {} +// CHECK: TypeRef=MyBase:9:19 Extent=[12:18 - 12:24] +}; + +template<typename Q> +struct Templ; + +template<typename MyBase> +struct Derived3: Templ<MyBase>::InnerIterator +{ + Derived3() : Templ<MyBase>::InnerIterator() {} +// CHECK: TemplateRef=Templ:17:8 Extent=[22:18 - 22:23] +// CHECK: TypeRef=MyBase:19:19 Extent=[22:24 - 22:30] +}; + + +struct Outer { + template <typename Q> + struct Inner { + typedef Q Parm; + }; +}; + +template<typename Q> +struct Derived4: Outer::Inner<Q>::Parm +{ + Derived4() : Outer::Inner<Q>::Parm() {} +// CHECK: TypeRef=struct Outer:28:8 Extent=[38:18 - 38:23] +// CHECK: TemplateRef=Inner:30:12 Extent=[38:25 - 38:30] +// CHECK: TypeRef=Q:35:19 Extent=[38:31 - 38:32] +}; + +template<typename Q> +struct Derived5: Outer::Inner<Q>::Parm::InnerIterator +{ + Derived5() : Outer::Inner<Q>::Parm::InnerIterator() {} +// CHECK: TypeRef=struct Outer:28:8 Extent=[47:18 - 47:23] +// CHECK: TemplateRef=Inner:30:12 Extent=[47:25 - 47:30] +// CHECK: TypeRef=Q:44:19 Extent=[47:31 - 47:32] +}; + +template<typename Q> +struct Derived6: Outer::Inner<Q> +{ + Derived6() : Outer::Inner<Q>() {} +// CHECK: TypeRef=struct Outer:28:8 Extent=[56:18 - 56:23] +// CHECK: TemplateRef=Inner:30:12 Extent=[56:25 - 56:30] +// CHECK: TypeRef=Q:53:19 Extent=[56:31 - 56:32] +}; + +struct Base {}; + +struct Derived7: Outer::Inner<Base>::Parm +{ + Derived7() : Outer::Inner<Base>::Parm() {} +// CHECK: TypeRef=struct Outer:28:8 Extent=[66:18 - 66:23] +// CHECK: TemplateRef=Inner:30:12 Extent=[66:25 - 66:30] +// CHECK: TypeRef=struct Base:62:8 Extent=[66:31 - 66:35] +}; + +struct Derived8: Outer::Inner<Base> +{ + Derived8() : Outer::Inner<Base>() {} +// CHECK: TypeRef=struct Outer:28:8 Extent=[74:18 - 74:23] +// CHECK: TemplateRef=Inner:30:12 Extent=[74:25 - 74:30] +// CHECK: TypeRef=struct Base:62:8 Extent=[74:31 - 74:35] +}; + +namespace Namespace { + template<typename Q> struct Templ; + + struct Outer { + template <typename Q> + struct Inner { + typedef Q Parm; + }; + }; +} + +template<typename MyBase> +struct Derived9: Namespace::Templ<MyBase>::InnerIterator +{ + Derived9() : Namespace::Templ<MyBase>::InnerIterator() {} +// CHECK: NamespaceRef=Namespace:80:11 Extent=[94:18 - 94:27] +// CHECK: TemplateRef=Templ:81:33 Extent=[94:29 - 94:34] +// CHECK: TypeRef=MyBase:91:19 Extent=[94:35 - 94:41] +}; + +template<typename MyBase> +struct Derived10: Namespace::Templ<MyBase> +{ + Derived10() : Namespace::Templ<MyBase>() {} +// CHECK: NamespaceRef=Namespace:80:11 Extent=[103:19 - 103:28] +// CHECK: TemplateRef=Templ:81:33 Extent=[103:30 - 103:35] +// CHECK: TypeRef=MyBase:100:19 Extent=[103:36 - 103:42] +}; + +template<typename MyBase> +struct Derived11: Namespace::Outer::Inner<MyBase>::Parm +{ + Derived11() : Namespace::Outer::Inner<MyBase>::Parm() {} +// CHECK: NamespaceRef=Namespace:80:11 Extent=[112:19 - 112:28] +// CHECK: TypeRef=struct Namespace::Outer:83:12 Extent=[112:30 - 112:35] +// CHECK: TemplateRef=Inner:85:16 Extent=[112:37 - 112:42] +// CHECK: TypeRef=MyBase:109:19 Extent=[112:43 - 112:49] +}; diff --git a/test/Index/get-cursor.cpp b/test/Index/get-cursor.cpp index 27f75938fedd..8aa12d5bc310 100644 --- a/test/Index/get-cursor.cpp +++ b/test/Index/get-cursor.cpp @@ -145,6 +145,13 @@ void test(TestColl coll) { const int operator""_toint(unsigned long long val) { return int(val); } +// noexcept specifications +void f_noexcept() noexcept; +template <class T> void f_computed_noexcept(T t) noexcept(noexcept(t+t)); +void f_dynamic_noexcept_none() throw(); +void f_dynamic_noexcept() throw(int); +void f_dynamic_noexcept_any() throw(...); + // RUN: c-index-test -cursor-at=%s:6:4 %s | FileCheck -check-prefix=CHECK-COMPLETION-1 %s // CHECK-COMPLETION-1: CXXConstructor=X:6:3 // CHECK-COMPLETION-1-NEXT: Completion string: {TypedText X}{LeftParen (}{Placeholder int}{Comma , }{Placeholder int}{RightParen )} @@ -209,11 +216,11 @@ const int operator""_toint(unsigned long long val) { return int(val); } // RUN: c-index-test -cursor-at=%s:66:23 %s | FileCheck -check-prefix=CHECK-TEMPLSPEC %s // CHECK-TEMPLSPEC: 66:23 ClassDecl=TC:66:23 (Definition) [Specialization of TC:59:7] Extent=[66:1 - 66:31] Spelling=TC ([66:23 - 66:25]) -// RUN: c-index-test -cursor-at=%s:69:3 -cursor-at=%s:70:11 -cursor-at=%s:73:6 -cursor-at=%s:74:6 -cursor-at=%s:77:8 -cursor-at=%s:78:8 -cursor-at=%s:79:8 -cursor-at=%s:80:8 -cursor-at=%s:81:8 -cursor-at=%s:82:8 -cursor-at=%s:85:6 -cursor-at=%s:86:6 -cursor-at=%s:87:6 -cursor-at=%s:88:6 -cursor-at=%s:91:5 -cursor-at=%s:92:5 -cursor-at=%s:93:5 -cursor-at=%s:94:5 -cursor-at=%s:95:5 -cursor-at=%s:96:5 -cursor-at=%s:97:5 -cursor-at=%s:98:5 -cursor-at=%s:100:5 -cursor-at=%s:101:5 -cursor-at=%s:104:6 -cursor-at=%s:105:6 -cursor-at=%s:106:6 -cursor-at=%s:107:6 -cursor-at=%s:108:6 -cursor-at=%s:109:6 -cursor-at=%s:110:6 -cursor-at=%s:111:6 -cursor-at=%s:113:6 -cursor-at=%s:114:6 -cursor-at=%s:117:8 -cursor-at=%s:118:8 -cursor-at=%s:120:8 -cursor-at=%s:121:8 -cursor-at=%s:122:8 -cursor-at=%s:123:8 -cursor-at=%s:124:8 -cursor-at=%s:125:8 -cursor-at=%s:128:6 -cursor-at=%s:129:6 -cursor-at=%s:130:6 -cursor-at=%s:132:3 -cursor-at=%s:146:15 -std=c++11 %s | FileCheck -check-prefix=CHECK-SPELLING %s +// RUN: c-index-test -cursor-at=%s:69:3 -cursor-at=%s:70:11 -cursor-at=%s:73:6 -cursor-at=%s:74:6 -cursor-at=%s:77:8 -cursor-at=%s:78:8 -cursor-at=%s:79:8 -cursor-at=%s:80:8 -cursor-at=%s:81:8 -cursor-at=%s:82:8 -cursor-at=%s:85:6 -cursor-at=%s:86:6 -cursor-at=%s:87:6 -cursor-at=%s:88:6 -cursor-at=%s:91:5 -cursor-at=%s:92:5 -cursor-at=%s:93:5 -cursor-at=%s:94:5 -cursor-at=%s:95:5 -cursor-at=%s:96:5 -cursor-at=%s:97:5 -cursor-at=%s:98:5 -cursor-at=%s:100:5 -cursor-at=%s:101:5 -cursor-at=%s:104:6 -cursor-at=%s:105:6 -cursor-at=%s:106:6 -cursor-at=%s:107:6 -cursor-at=%s:108:6 -cursor-at=%s:109:6 -cursor-at=%s:110:6 -cursor-at=%s:111:6 -cursor-at=%s:113:6 -cursor-at=%s:114:6 -cursor-at=%s:117:8 -cursor-at=%s:118:8 -cursor-at=%s:120:8 -cursor-at=%s:121:8 -cursor-at=%s:122:8 -cursor-at=%s:123:8 -cursor-at=%s:124:8 -cursor-at=%s:125:8 -cursor-at=%s:128:6 -cursor-at=%s:129:6 -cursor-at=%s:130:6 -cursor-at=%s:132:3 -cursor-at=%s:146:15 -cursor-at=%s:149:6 -cursor-at=%s:150:25 -cursor-at=%s:151:6 -cursor-at=%s:152:6 -cursor-at=%s:153:6 -std=c++11 %s | FileCheck -check-prefix=CHECK-SPELLING %s // CHECK-SPELLING: 69:3 CXXConstructor=A:69:3 (default constructor) Extent=[69:3 - 69:6] Spelling=A ([69:3 - 69:4]) // CHECK-SPELLING: 70:11 CXXDestructor=~A:70:11 (virtual) Extent=[70:3 - 70:15] Spelling=~A ([70:11 - 70:13]) // CHECK-SPELLING: 73:6 CXXMethod=operator=:73:6 Extent=[73:3 - 73:25] Spelling=operator= ([73:6 - 73:15]) -// CHECK-SPELLING: 74:6 CXXMethod=operator=:74:6 Extent=[74:3 - 74:29] Spelling=operator= ([74:6 - 74:15]) +// CHECK-SPELLING: 74:6 CXXMethod=operator=:74:6 (noexcept) Extent=[74:3 - 74:29] Spelling=operator= ([74:6 - 74:15]) // CHECK-SPELLING: 77:8 CXXMethod=operator+:77:8 (const) Extent=[77:3 - 77:25] Spelling=operator+ ([77:8 - 77:17]) // CHECK-SPELLING: 78:8 CXXMethod=operator-:78:8 (const) Extent=[78:3 - 78:25] Spelling=operator- ([78:8 - 78:17]) // CHECK-SPELLING: 79:8 CXXMethod=operator~:79:8 (const) Extent=[79:3 - 79:25] Spelling=operator~ ([79:8 - 79:17]) @@ -257,8 +264,14 @@ const int operator""_toint(unsigned long long val) { return int(val); } // CHECK-SPELLING: 130:6 CXXMethod=operator():130:6 (const) Extent=[130:3 - 130:37] Spelling=operator() ([130:6 - 130:16]) // CHECK-SPELLING: 132:12 CXXConversion=operator bool:132:12 (const) Extent=[132:3 - 132:33] Spelling=operator bool ([132:12 - 132:25]) // CHECK-SPELLING: 146:11 FunctionDecl=operator""_toint:146:11 (Definition) Extent=[146:1 - 146:72] Spelling=operator""_toint ([146:11 - 146:27]) +// CHECK-SPELLING: 149:6 FunctionDecl=f_noexcept:149:6 (noexcept) Extent=[149:1 - 149:27] Spelling=f_noexcept ([149:6 - 149:16]) +// CHECK-SPELLING: 150:25 FunctionTemplate=f_computed_noexcept:150:25 (computed-noexcept) Extent=[150:1 - 150:73] Spelling=f_computed_noexcept ([150:25 - 150:44]) +// CHECK-SPELLING: 151:6 FunctionDecl=f_dynamic_noexcept_none:151:6 (noexcept dynamic none) Extent=[151:1 - 151:39] Spelling=f_dynamic_noexcept_none ([151:6 - 151:29]) +// CHECK-SPELLING: 152:6 FunctionDecl=f_dynamic_noexcept:152:6 (noexcept dynamic) Extent=[152:1 - 152:37] Spelling=f_dynamic_noexcept ([152:6 - 152:24]) +// CHECK-SPELLING: 153:6 FunctionDecl=f_dynamic_noexcept_any:153:6 (noexcept dynamic any) Extent=[153:1 - 153:41] Spelling=f_dynamic_noexcept_any ([153:6 - 153:28]) // RUN: c-index-test -cursor-at=%s:141:13 -cursor-at=%s:141:18 -cursor-at=%s:142:11 -std=c++11 %s | FileCheck -check-prefix=CHECK-FORRANGE %s // CHECK-FORRANGE: 141:13 VarDecl=lv:141:13 (Definition) Extent=[141:8 - 141:17] Spelling=lv ([141:13 - 141:15]) // CHECK-FORRANGE: 141:18 DeclRefExpr=coll:140:20 Extent=[141:18 - 141:22] Spelling=coll ([141:18 - 141:22]) // CHECK-FORRANGE: 142:11 DeclRefExpr=lv:141:13 Extent=[142:11 - 142:13] Spelling=lv ([142:11 - 142:13]) + diff --git a/test/Index/linkage.c b/test/Index/linkage.c index ab006590b61c..b0dcb30990a0 100644 --- a/test/Index/linkage.c +++ b/test/Index/linkage.c @@ -20,7 +20,7 @@ void f16(void) { // CHECK: EnumDecl=Baz:3:6 (Definition)linkage=External -// CHECK: EnumConstantDecl=Qux:3:12 (Definition)linkage=External +// CHECK: EnumConstantDecl=Qux:3:12 (Definition)linkage=NoLinkage // CHECK: VarDecl=x:4:5linkage=External // CHECK: FunctionDecl=foo:5:6linkage=External // CHECK: VarDecl=w:6:12linkage=Internal diff --git a/test/Modules/Inputs/F.framework/Headers/F.h b/test/Modules/Inputs/F.framework/Headers/F.h new file mode 100644 index 000000000000..4f705f00e1ac --- /dev/null +++ b/test/Modules/Inputs/F.framework/Headers/F.h @@ -0,0 +1 @@ +// F.h diff --git a/test/Modules/Inputs/F.framework/Modules/module.modulemap b/test/Modules/Inputs/F.framework/Modules/module.modulemap new file mode 100644 index 000000000000..e414776c536b --- /dev/null +++ b/test/Modules/Inputs/F.framework/Modules/module.modulemap @@ -0,0 +1,7 @@ +framework module F [extern_c] [system] { + umbrella header "F.h" + module * { + export * + } + export * +} diff --git a/test/Modules/Inputs/F.framework/Modules/module.private.modulemap b/test/Modules/Inputs/F.framework/Modules/module.private.modulemap new file mode 100644 index 000000000000..69486a2a6410 --- /dev/null +++ b/test/Modules/Inputs/F.framework/Modules/module.private.modulemap @@ -0,0 +1,7 @@ +module F.Private [system] { + explicit module NS { + header "NS.h" + export * + } + export * +} diff --git a/test/Modules/Inputs/F.framework/PrivateHeaders/NS.h b/test/Modules/Inputs/F.framework/PrivateHeaders/NS.h new file mode 100644 index 000000000000..5e947ba90518 --- /dev/null +++ b/test/Modules/Inputs/F.framework/PrivateHeaders/NS.h @@ -0,0 +1,19 @@ +struct NS { + int a; + int b; +}; + +enum NSE { + FST = 22, + SND = 43, + TRD = 55 +}; + +#define NS_ENUM(_type, _name) \ + enum _name : _type _name; \ + enum _name : _type + +typedef NS_ENUM(int, NSMyEnum) { + MinX = 11, + MinXOther = MinX, +}; diff --git a/test/Modules/Inputs/lookup-assert-protocol/Base.h b/test/Modules/Inputs/lookup-assert-protocol/Base.h new file mode 100644 index 000000000000..5c9506fa5cd3 --- /dev/null +++ b/test/Modules/Inputs/lookup-assert-protocol/Base.h @@ -0,0 +1,3 @@ +@protocol BaseProtocol +- (void) test; +@end diff --git a/test/Modules/Inputs/lookup-assert-protocol/Derive.h b/test/Modules/Inputs/lookup-assert-protocol/Derive.h new file mode 100644 index 000000000000..fdcde6158a7c --- /dev/null +++ b/test/Modules/Inputs/lookup-assert-protocol/Derive.h @@ -0,0 +1,4 @@ +#include "Base.h" +@protocol DerivedProtocol<BaseProtocol> +- (void) test2; +@end diff --git a/test/Modules/Inputs/lookup-assert-protocol/H3.h b/test/Modules/Inputs/lookup-assert-protocol/H3.h new file mode 100644 index 000000000000..3d8f878905df --- /dev/null +++ b/test/Modules/Inputs/lookup-assert-protocol/H3.h @@ -0,0 +1 @@ +#include "Base.h" diff --git a/test/Modules/Inputs/lookup-assert-protocol/module.map b/test/Modules/Inputs/lookup-assert-protocol/module.map new file mode 100644 index 000000000000..e8a89eb095a4 --- /dev/null +++ b/test/Modules/Inputs/lookup-assert-protocol/module.map @@ -0,0 +1,4 @@ +module X { + header "H3.h" + export * +} diff --git a/test/Modules/Inputs/preprocess-decluse/a.h b/test/Modules/Inputs/preprocess-decluse/a.h new file mode 100644 index 000000000000..17ab46c84892 --- /dev/null +++ b/test/Modules/Inputs/preprocess-decluse/a.h @@ -0,0 +1 @@ +// a.h diff --git a/test/Modules/Inputs/preprocess-decluse/a.modulemap b/test/Modules/Inputs/preprocess-decluse/a.modulemap new file mode 100644 index 000000000000..47105fe36399 --- /dev/null +++ b/test/Modules/Inputs/preprocess-decluse/a.modulemap @@ -0,0 +1 @@ +module A { textual header "a.h" } diff --git a/test/Modules/Inputs/preprocess-decluse/b.h b/test/Modules/Inputs/preprocess-decluse/b.h new file mode 100644 index 000000000000..2243de1baf9a --- /dev/null +++ b/test/Modules/Inputs/preprocess-decluse/b.h @@ -0,0 +1 @@ +#include "a.h" diff --git a/test/Modules/Inputs/preprocess-decluse/b.modulemap b/test/Modules/Inputs/preprocess-decluse/b.modulemap new file mode 100644 index 000000000000..bd0bdf0e2e94 --- /dev/null +++ b/test/Modules/Inputs/preprocess-decluse/b.modulemap @@ -0,0 +1 @@ +module B { header "b.h" use A } diff --git a/test/Modules/Inputs/preprocess-decluse/main.modulemap b/test/Modules/Inputs/preprocess-decluse/main.modulemap new file mode 100644 index 000000000000..0392c846ce99 --- /dev/null +++ b/test/Modules/Inputs/preprocess-decluse/main.modulemap @@ -0,0 +1 @@ +module Main { use B } diff --git a/test/Modules/diag-flags.cpp b/test/Modules/diag-flags.cpp index 31d2fe4439b8..ada90d24b791 100644 --- a/test/Modules/diag-flags.cpp +++ b/test/Modules/diag-flags.cpp @@ -41,4 +41,4 @@ import diag_flags; #else // expected-no-diagnostics #endif -unsigned n = sizeof(Padded); +int arr[sizeof(Padded)]; diff --git a/test/Modules/elaborated-type-specifier-from-hidden-module.m b/test/Modules/elaborated-type-specifier-from-hidden-module.m index 0ca1c24bba00..571ccb9d95c0 100644 --- a/test/Modules/elaborated-type-specifier-from-hidden-module.m +++ b/test/Modules/elaborated-type-specifier-from-hidden-module.m @@ -4,12 +4,11 @@ @import ElaboratedTypeStructs.Empty; // The structs are now hidden. struct S1 *x; struct S2 *y; -// FIXME: compatible definition should not be an error. -struct S2 { int x; }; // expected-error {{redefinition}} +struct S2 { int x; }; struct S3 *z; // Incompatible definition. -struct S3 { float y; }; // expected-error {{redefinition}} -// expected-note@elaborated-type-structs.h:* 2 {{previous definition is here}} +struct S3 { float y; }; // expected-error {{has incompatible definitions}} // expected-note {{field has name}} +// expected-note@Inputs/elaborated-type-structs.h:3 {{field has name}} @import ElaboratedTypeStructs.Structs; diff --git a/test/Modules/lookup-assert-protocol.m b/test/Modules/lookup-assert-protocol.m new file mode 100644 index 000000000000..3c093f1bf156 --- /dev/null +++ b/test/Modules/lookup-assert-protocol.m @@ -0,0 +1,17 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/lookup-assert-protocol %s -verify +// expected-no-diagnostics + +#include "Derive.h" +#import <H3.h> + +__attribute__((objc_root_class)) +@interface Thing<DerivedProtocol> +@end + +@implementation Thing +- (void)test { +} +- (void)test2 { +} +@end diff --git a/test/Modules/odr_hash.cpp b/test/Modules/odr_hash.cpp index c94940c73eb6..6e01e989a374 100644 --- a/test/Modules/odr_hash.cpp +++ b/test/Modules/odr_hash.cpp @@ -968,6 +968,24 @@ S9 s9; // expected-error@second.h:* {{'NestedNamespaceSpecifier::S9' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type 'P9::I' (aka 'int')}} // expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type 'O9::I' (aka 'int')}} #endif + +namespace N10 { +#if defined(FIRST) +inline namespace A { struct X {}; } +struct S10 { + A::X x; +}; +#elif defined(SECOND) +inline namespace B { struct X {}; } +struct S10 { + B::X x; +}; +#else +S10 s10; +// expected-error@second.h:* {{'NestedNamespaceSpecifier::N10::S10::x' from module 'SecondModule' is not present in definition of 'NestedNamespaceSpecifier::N10::S10' in module 'FirstModule'}} +// expected-note@first.h:* {{declaration of 'x' does not match}} +#endif +} } namespace TemplateSpecializationType { @@ -1070,6 +1088,40 @@ S4 s4; // expected-error@first.h:* {{'TemplateArgument::S4::x' from module 'FirstModule' is not present in definition of 'TemplateArgument::S4' in module 'SecondModule'}} // expected-note@second.h:* {{declaration of 'x' does not match}} #endif + +#if defined(FIRST) +template <class T> struct U5 {}; +struct S5 { + U5<int> x; +}; +#elif defined(SECOND) +template <class T> struct U5 {}; +struct S5 { + U5<short> x; +}; +#else +S5 s5; +// expected-error@first.h:* {{'TemplateArgument::S5::x' from module 'FirstModule' is not present in definition of 'TemplateArgument::S5' in module 'SecondModule'}} +// expected-note@second.h:* {{declaration of 'x' does not match}} +#endif + +#if defined(FIRST) +template <class T> struct U6 {}; +struct S6 { + U6<int> x; + U6<short> y; +}; +#elif defined(SECOND) +template <class T> struct U6 {}; +struct S6 { + U6<short> y; + U6<int> x; +}; +#else +S6 s6; +// expected-error@second.h:* {{'TemplateArgument::S6' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'y'}} +// expected-note@first.h:* {{but in 'FirstModule' found field 'x'}} +#endif } namespace TemplateTypeParmType { @@ -1762,6 +1814,22 @@ struct S2 { #else S2 s2; #endif + +#if defined(FIRST) +using A3 = const int; +using B3 = volatile A3; +struct S3 { + B3 x = 1; +}; +#elif defined(SECOND) +using A3 = volatile const int; +using B3 = A3; +struct S3 { + B3 x = 1; +}; +#else +S3 s3; +#endif } // Keep macros contained to one file. diff --git a/test/Modules/preprocess-decluse.cpp b/test/Modules/preprocess-decluse.cpp new file mode 100644 index 000000000000..5c87e0dddac2 --- /dev/null +++ b/test/Modules/preprocess-decluse.cpp @@ -0,0 +1,18 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules -fmodules-strict-decluse -I%S/Inputs/preprocess-decluse \ +// RUN: -fmodule-name=B -emit-module -o %t/b.pcm \ +// RUN: -fmodule-map-file=%S/Inputs/preprocess-decluse/a.modulemap \ +// RUN: -x c++-module-map %S/Inputs/preprocess-decluse/b.modulemap +// RUN: %clang_cc1 -fmodules -fmodules-strict-decluse -I%S/Inputs/preprocess-decluse \ +// RUN: -fmodule-map-file=%S/Inputs/preprocess-decluse/main.modulemap \ +// RUN: -fmodule-file=%t/b.pcm -fmodule-name=Main %s -verify +// RUN: %clang_cc1 -fmodules -fmodules-strict-decluse -I%S/Inputs/preprocess-decluse \ +// RUN: -fmodule-map-file=%S/Inputs/preprocess-decluse/main.modulemap \ +// RUN: -fmodule-file=%t/b.pcm -fmodule-name=Main %s \ +// RUN: -E -frewrite-imports -o %t/rewrite.ii +// RUN: %clang_cc1 -fmodules -fmodules-strict-decluse -I%S/Inputs/preprocess-decluse \ +// RUN: -fmodule-map-file=%S/Inputs/preprocess-decluse/main.modulemap \ +// RUN: -fmodule-name=Main %t/rewrite.ii -verify + +// expected-no-diagnostics +#include "b.h" diff --git a/test/Modules/redefinition-c-tagtypes.m b/test/Modules/redefinition-c-tagtypes.m new file mode 100644 index 000000000000..a01f11bd74c8 --- /dev/null +++ b/test/Modules/redefinition-c-tagtypes.m @@ -0,0 +1,48 @@ +// RUN: rm -rf %t.cache +// RUN: %clang_cc1 -fsyntax-only %s -fmodules -fmodules-cache-path=%t.cache \ +// RUN: -fimplicit-module-maps -F%S/Inputs -verify +// RUN: %clang_cc1 -fsyntax-only %s -fmodules -fmodules-cache-path=%t.cache \ +// RUN: -fimplicit-module-maps -F%S/Inputs -DCHANGE_TAGS -verify +#include "F/F.h" + +#ifndef CHANGE_TAGS +// expected-no-diagnostics +#endif + +struct NS { + int a; +#ifndef CHANGE_TAGS + int b; +#else + int c; // expected-note {{field has name 'c' here}} + // expected-error@redefinition-c-tagtypes.m:12 {{type 'struct NS' has incompatible definitions}} + // expected-note@Inputs/F.framework/PrivateHeaders/NS.h:3 {{field has name 'b' here}} +#endif +}; + +enum NSE { + FST = 22, +#ifndef CHANGE_TAGS + SND = 43, +#else + SND = 44, // expected-note {{enumerator 'SND' with value 44 here}} + // expected-error@redefinition-c-tagtypes.m:23 {{type 'enum NSE' has incompatible definitions}} + // expected-note@Inputs/F.framework/PrivateHeaders/NS.h:8 {{enumerator 'SND' with value 43 here}} +#endif + TRD = 55 +}; + +#define NS_ENUM(_type, _name) \ + enum _name : _type _name; \ + enum _name : _type + +typedef NS_ENUM(int, NSMyEnum) { + MinX = 11, +#ifndef CHANGE_TAGS + MinXOther = MinX, +#else + MinXOther = TRD, // expected-note {{enumerator 'MinXOther' with value 55 here}} + // expected-error@redefinition-c-tagtypes.m:39 {{type 'enum NSMyEnum' has incompatible definitions}} + // expected-note@Inputs/F.framework/PrivateHeaders/NS.h:18 {{enumerator 'MinXOther' with value 11 here}} +#endif +}; diff --git a/test/Modules/redefinition-same-header.m b/test/Modules/redefinition-same-header.m index f1c6cbbcaa2e..8c180f643225 100644 --- a/test/Modules/redefinition-same-header.m +++ b/test/Modules/redefinition-same-header.m @@ -6,15 +6,7 @@ // expected-note-re@Inputs/SameHeader/B.h:3 {{'{{.*}}C.h' included multiple times, additional include site in header from module 'X.B'}} // expected-note@Inputs/SameHeader/module.modulemap:6 {{X.B defined here}} // expected-note-re@redefinition-same-header.m:20 {{'{{.*}}C.h' included multiple times, additional include site here}} +// expected-warning@Inputs/SameHeader/C.h:9 {{typedef requires a name}} -// expected-error@Inputs/SameHeader/C.h:5 {{redefinition of 'aaa'}} -// expected-note-re@Inputs/SameHeader/B.h:3 {{'{{.*}}C.h' included multiple times, additional include site in header from module 'X.B'}} -// expected-note@Inputs/SameHeader/module.modulemap:6 {{X.B defined here}} -// expected-note-re@redefinition-same-header.m:20 {{'{{.*}}C.h' included multiple times, additional include site here}} - -// expected-error@Inputs/SameHeader/C.h:9 {{redefinition of 'fd_set'}} -// expected-note-re@Inputs/SameHeader/B.h:3 {{'{{.*}}C.h' included multiple times, additional include site in header from module 'X.B'}} -// expected-note@Inputs/SameHeader/module.modulemap:6 {{X.B defined here}} -// expected-note-re@redefinition-same-header.m:20 {{'{{.*}}C.h' included multiple times, additional include site here}} #include "A.h" // maps to a modular #include "C.h" // textual include diff --git a/test/OpenMP/parallel_codegen.cpp b/test/OpenMP/parallel_codegen.cpp index c43533c6c194..23b323778b47 100644 --- a/test/OpenMP/parallel_codegen.cpp +++ b/test/OpenMP/parallel_codegen.cpp @@ -64,7 +64,7 @@ int main (int argc, char **argv) { // CHECK: call {{.*}}void @{{.+terminate.*|abort}}( // CHECK-NEXT: unreachable // CHECK-NEXT: } -// CHECK-DEBUG: define internal void [[OMP_OUTLINED]](i32* noalias %.global_tid., i32* noalias %.bound_tid., i64 [[VLA_SIZE:%.+]], i32* [[VLA_ADDR:%[^)]+]]) +// CHECK-DEBUG: define internal void [[OMP_OUTLINED_DEBUG:@.+]](i32* noalias %.global_tid., i32* noalias %.bound_tid., i64 [[VLA_SIZE:%.+]], i32* [[VLA_ADDR:%[^)]+]]) // CHECK-DEBUG-SAME: #[[FN_ATTRS:[0-9]+]] // CHECK-DEBUG: store i32* [[VLA_ADDR]], i32** [[VLA_PTR_ADDR:%.+]], // CHECK-DEBUG: [[VLA_REF:%.+]] = load i32*, i32** [[VLA_PTR_ADDR]] @@ -80,6 +80,8 @@ int main (int argc, char **argv) { // CHECK-DAG: declare {{.*}}void @__kmpc_fork_call(%ident_t*, i32, void (i32*, i32*, ...)*, ...) // CHECK-DEBUG-DAG: define linkonce_odr void [[FOO]](i32 %argc) // CHECK-DEBUG-DAG: declare void @__kmpc_fork_call(%ident_t*, i32, void (i32*, i32*, ...)*, ...) +// CHECK-DEBUG-DAG: define internal void [[OMP_OUTLINED]](i32* noalias %.global_tid., i32* noalias %.bound_tid., i64 [[VLA_SIZE:%.+]], i32* [[VLA_ADDR:%[^)]+]]) +// CHECK-DEBUG-DAG: call void [[OMP_OUTLINED_DEBUG]] // CHECK: define linkonce_odr {{[a-z\_\b]*[ ]?i32}} [[TMAIN]](i8** %argc) // CHECK: store i8** %argc, i8*** [[ARGC_ADDR:%.+]], diff --git a/test/OpenMP/target_codegen.cpp b/test/OpenMP/target_codegen.cpp index aaaf5fae5729..c457045c17c7 100644 --- a/test/OpenMP/target_codegen.cpp +++ b/test/OpenMP/target_codegen.cpp @@ -117,10 +117,10 @@ int foo(int n) { // CHECK-DAG: [[P]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[PR:%[^,]+]], i32 0, i32 0 // CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[BPR]], i32 0, i32 [[IDX0:[0-9]+]] // CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[PR]], i32 0, i32 [[IDX0]] - // CHECK-DAG: store i8* [[BP0:%[^,]+]], i8** [[BPADDR0]] - // CHECK-DAG: store i8* [[P0:%[^,]+]], i8** [[PADDR0]] - // CHECK-DAG: [[BP0]] = inttoptr i[[SZ]] %{{.+}} to i8* - // CHECK-DAG: [[P0]] = inttoptr i[[SZ]] %{{.+}} to i8* + // CHECK-DAG: [[CBPADDR0:%.+]] = bitcast i8** [[BPADDR0]] to i[[SZ]]* + // CHECK-DAG: [[CPADDR0:%.+]] = bitcast i8** [[PADDR0]] to i[[SZ]]* + // CHECK-DAG: store i[[SZ]] [[BP0:%[^,]+]], i[[SZ]]* [[CBPADDR0]] + // CHECK-DAG: store i[[SZ]] [[P0:%[^,]+]], i[[SZ]]* [[CPADDR0]] // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 // CHECK: [[RET2:%.+]] = load i32, i32* [[RHV]], align 4 @@ -144,17 +144,17 @@ int foo(int n) { // CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BP]], i32 0, i32 0 // CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[P]], i32 0, i32 0 - // CHECK-DAG: store i8* [[BP0:%[^,]+]], i8** [[BPADDR0]] - // CHECK-DAG: store i8* [[P0:%[^,]+]], i8** [[PADDR0]] - // CHECK-DAG: [[BP0]] = inttoptr i[[SZ]] %{{.+}} to i8* - // CHECK-DAG: [[P0]] = inttoptr i[[SZ]] %{{.+}} to i8* + // CHECK-DAG: [[CBPADDR0:%.+]] = bitcast i8** [[BPADDR0]] to i[[SZ]]* + // CHECK-DAG: [[CPADDR0:%.+]] = bitcast i8** [[PADDR0]] to i[[SZ]]* + // CHECK-DAG: store i[[SZ]] [[BP0:%[^,]+]], i[[SZ]]* [[CBPADDR0]] + // CHECK-DAG: store i[[SZ]] [[P0:%[^,]+]], i[[SZ]]* [[CPADDR0]] // CHECK-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BP]], i32 0, i32 1 // CHECK-DAG: [[PADDR1:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[P]], i32 0, i32 1 - // CHECK-DAG: store i8* [[BP1:%[^,]+]], i8** [[BPADDR1]] - // CHECK-DAG: store i8* [[P1:%[^,]+]], i8** [[PADDR1]] - // CHECK-DAG: [[BP1]] = inttoptr i[[SZ]] %{{.+}} to i8* - // CHECK-DAG: [[P1]] = inttoptr i[[SZ]] %{{.+}} to i8* + // CHECK-DAG: [[CBPADDR1:%.+]] = bitcast i8** [[BPADDR1]] to i[[SZ]]* + // CHECK-DAG: [[CPADDR1:%.+]] = bitcast i8** [[PADDR1]] to i[[SZ]]* + // CHECK-DAG: store i[[SZ]] [[BP1:%[^,]+]], i[[SZ]]* [[CBPADDR1]] + // CHECK-DAG: store i[[SZ]] [[P1:%[^,]+]], i[[SZ]]* [[CPADDR1]] // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 // CHECK-NEXT: br label %[[IFEND:.+]] @@ -198,87 +198,89 @@ int foo(int n) { // CHECK-DAG: [[PR]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[P:%[^,]+]], i32 0, i32 0 // CHECK-DAG: [[SR]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S:%[^,]+]], i32 0, i32 0 - // CHECK-DAG: [[SADDR0:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX0:[0-9]+]] + // CHECK-DAG: [[SADDR0:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX0:0]] // CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BP]], i32 0, i32 [[IDX0]] // CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[P]], i32 0, i32 [[IDX0]] - // CHECK-DAG: [[SADDR1:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX1:[0-9]+]] + // CHECK-DAG: [[SADDR1:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX1:1]] // CHECK-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BP]], i32 0, i32 [[IDX1]] // CHECK-DAG: [[PADDR1:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[P]], i32 0, i32 [[IDX1]] - // CHECK-DAG: [[SADDR2:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX2:[0-9]+]] + // CHECK-DAG: [[SADDR2:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX2:2]] // CHECK-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BP]], i32 0, i32 [[IDX2]] // CHECK-DAG: [[PADDR2:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[P]], i32 0, i32 [[IDX2]] - // CHECK-DAG: [[SADDR3:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX3:[0-9]+]] + // CHECK-DAG: [[SADDR3:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX3:3]] // CHECK-DAG: [[BPADDR3:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BP]], i32 0, i32 [[IDX3]] // CHECK-DAG: [[PADDR3:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[P]], i32 0, i32 [[IDX3]] - // CHECK-DAG: [[SADDR4:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX4:[0-9]+]] + // CHECK-DAG: [[SADDR4:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX4:4]] // CHECK-DAG: [[BPADDR4:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BP]], i32 0, i32 [[IDX4]] // CHECK-DAG: [[PADDR4:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[P]], i32 0, i32 [[IDX4]] - // CHECK-DAG: [[SADDR5:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX5:[0-9]+]] + // CHECK-DAG: [[SADDR5:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX5:5]] // CHECK-DAG: [[BPADDR5:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BP]], i32 0, i32 [[IDX5]] // CHECK-DAG: [[PADDR5:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[P]], i32 0, i32 [[IDX5]] - // CHECK-DAG: [[SADDR6:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX6:[0-9]+]] + // CHECK-DAG: [[SADDR6:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX6:6]] // CHECK-DAG: [[BPADDR6:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BP]], i32 0, i32 [[IDX6]] // CHECK-DAG: [[PADDR6:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[P]], i32 0, i32 [[IDX6]] - // CHECK-DAG: [[SADDR7:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX7:[0-9]+]] + // CHECK-DAG: [[SADDR7:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX7:7]] // CHECK-DAG: [[BPADDR7:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BP]], i32 0, i32 [[IDX7]] // CHECK-DAG: [[PADDR7:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[P]], i32 0, i32 [[IDX7]] - // CHECK-DAG: [[SADDR8:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX8:[0-9]+]] + // CHECK-DAG: [[SADDR8:%.+]] = getelementptr inbounds [9 x i[[SZ]]], [9 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX8:8]] // CHECK-DAG: [[BPADDR8:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BP]], i32 0, i32 [[IDX8]] // CHECK-DAG: [[PADDR8:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[P]], i32 0, i32 [[IDX8]] // The names below are not necessarily consistent with the names used for the // addresses above as some are repeated. - // CHECK-DAG: [[BP0:%[^,]+]] = inttoptr i[[SZ]] [[VLA0]] to i8* - // CHECK-DAG: [[P0:%[^,]+]] = inttoptr i[[SZ]] [[VLA0]] to i8* - // CHECK-DAG: store i8* [[BP0]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P0]], i8** {{%[^,]+}} - // CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* {{%[^,]+}} - - // CHECK-DAG: [[BP1:%[^,]+]] = inttoptr i[[SZ]] [[VLA1]] to i8* - // CHECK-DAG: [[P1:%[^,]+]] = inttoptr i[[SZ]] [[VLA1]] to i8* - // CHECK-DAG: store i8* [[BP1]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P1]], i8** {{%[^,]+}} - // CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* {{%[^,]+}} - - // CHECK-DAG: store i8* inttoptr (i[[SZ]] 5 to i8*), i8** {{%[^,]+}} - // CHECK-DAG: store i8* inttoptr (i[[SZ]] 5 to i8*), i8** {{%[^,]+}} - // CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* {{%[^,]+}} - - // CHECK-DAG: [[BP3:%[^,]+]] = inttoptr i[[SZ]] [[A_CVAL]] to i8* - // CHECK-DAG: [[P3:%[^,]+]] = inttoptr i[[SZ]] [[A_CVAL]] to i8* - // CHECK-DAG: store i8* [[BP3]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P3]], i8** {{%[^,]+}} - // CHECK-DAG: store i[[SZ]] 4, i[[SZ]]* {{%[^,]+}} - - // CHECK-DAG: [[BP4:%[^,]+]] = bitcast [10 x float]* %{{.+}} to i8* - // CHECK-DAG: [[P4:%[^,]+]] = bitcast [10 x float]* %{{.+}} to i8* - // CHECK-DAG: store i8* [[BP4]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P4]], i8** {{%[^,]+}} - // CHECK-DAG: store i[[SZ]] 40, i[[SZ]]* {{%[^,]+}} - - // CHECK-DAG: [[BP5:%[^,]+]] = bitcast float* %{{.+}} to i8* - // CHECK-DAG: [[P5:%[^,]+]] = bitcast float* %{{.+}} to i8* - // CHECK-DAG: store i8* [[BP5]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P5]], i8** {{%[^,]+}} - // CHECK-DAG: store i[[SZ]] [[BNSIZE]], i[[SZ]]* {{%[^,]+}} - - // CHECK-DAG: [[BP6:%[^,]+]] = bitcast [5 x [10 x double]]* %{{.+}} to i8* - // CHECK-DAG: [[P6:%[^,]+]] = bitcast [5 x [10 x double]]* %{{.+}} to i8* - // CHECK-DAG: store i8* [[BP6]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P6]], i8** {{%[^,]+}} - // CHECK-DAG: store i[[SZ]] 400, i[[SZ]]* {{%[^,]+}} - - // CHECK-DAG: [[BP7:%[^,]+]] = bitcast double* %{{.+}} to i8* - // CHECK-DAG: [[P7:%[^,]+]] = bitcast double* %{{.+}} to i8* - // CHECK-DAG: store i8* [[BP7]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P7]], i8** {{%[^,]+}} - // CHECK-DAG: store i[[SZ]] [[CNSIZE]], i[[SZ]]* {{%[^,]+}} - - // CHECK-DAG: [[BP8:%[^,]+]] = bitcast [[TT]]* %{{.+}} to i8* - // CHECK-DAG: [[P8:%[^,]+]] = bitcast [[TT]]* %{{.+}} to i8* - // CHECK-DAG: store i8* [[BP8]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P8]], i8** {{%[^,]+}} - // CHECK-DAG: store i[[SZ]] {{12|16}}, i[[SZ]]* {{%[^,]+}} + // CHECK-DAG: [[CBPADDR2:%.+]] = bitcast i8** [[BPADDR2]] to i[[SZ]]* + // CHECK-DAG: [[CPADDR2:%.+]] = bitcast i8** [[PADDR2]] to i[[SZ]]* + // CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CBPADDR2]] + // CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CPADDR2]] + // CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* [[SADDR2]] + + // CHECK-DAG: [[CBPADDR6:%.+]] = bitcast i8** [[BPADDR6]] to i[[SZ]]* + // CHECK-DAG: [[CPADDR6:%.+]] = bitcast i8** [[PADDR6]] to i[[SZ]]* + // CHECK-DAG: store i[[SZ]] [[VLA1]], i[[SZ]]* [[CBPADDR6]] + // CHECK-DAG: store i[[SZ]] [[VLA1]], i[[SZ]]* [[CPADDR6]] + // CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* [[SADDR6]] + + // CHECK-DAG: [[CBPADDR5:%.+]] = bitcast i8** [[BPADDR5]] to i[[SZ]]* + // CHECK-DAG: [[CPADDR5:%.+]] = bitcast i8** [[PADDR5]] to i[[SZ]]* + // CHECK-DAG: store i[[SZ]] 5, i[[SZ]]* [[CBPADDR5]] + // CHECK-DAG: store i[[SZ]] 5, i[[SZ]]* [[CPADDR5]] + // CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* [[SADDR5]] + + // CHECK-DAG: [[CBPADDR0:%.+]] = bitcast i8** [[BPADDR0]] to i[[SZ]]* + // CHECK-DAG: [[CPADDR0:%.+]] = bitcast i8** [[PADDR0]] to i[[SZ]]* + // CHECK-DAG: store i[[SZ]] [[A_CVAL]], i[[SZ]]* [[CBPADDR0]] + // CHECK-DAG: store i[[SZ]] [[A_CVAL]], i[[SZ]]* [[CPADDR0]] + // CHECK-DAG: store i[[SZ]] 4, i[[SZ]]* [[SADDR0]] + + // CHECK-DAG: [[CBPADDR1:%.+]] = bitcast i8** [[BPADDR1]] to [10 x float]** + // CHECK-DAG: [[CPADDR1:%.+]] = bitcast i8** [[PADDR1]] to [10 x float]** + // CHECK-DAG: store [10 x float]* %{{.+}}, [10 x float]** [[CBPADDR1]] + // CHECK-DAG: store [10 x float]* %{{.+}}, [10 x float]** [[CPADDR1]] + // CHECK-DAG: store i[[SZ]] 40, i[[SZ]]* [[SADDR1]] + + // CHECK-DAG: [[CBPADDR3:%.+]] = bitcast i8** [[BPADDR3]] to float** + // CHECK-DAG: [[CPADDR3:%.+]] = bitcast i8** [[PADDR3]] to float** + // CHECK-DAG: store float* %{{.+}}, float** [[CBPADDR3]] + // CHECK-DAG: store float* %{{.+}}, float** [[CPADDR3]] + // CHECK-DAG: store i[[SZ]] [[BNSIZE]], i[[SZ]]* [[SADDR3]] + + // CHECK-DAG: [[CBPADDR4:%.+]] = bitcast i8** [[BPADDR4]] to [5 x [10 x double]]** + // CHECK-DAG: [[CPADDR4:%.+]] = bitcast i8** [[PADDR4]] to [5 x [10 x double]]** + // CHECK-DAG: store [5 x [10 x double]]* %{{.+}}, [5 x [10 x double]]** [[CBPADDR4]] + // CHECK-DAG: store [5 x [10 x double]]* %{{.+}}, [5 x [10 x double]]** [[CPADDR4]] + // CHECK-DAG: store i[[SZ]] 400, i[[SZ]]* [[SADDR4]] + + // CHECK-DAG: [[CBPADDR7:%.+]] = bitcast i8** [[BPADDR7]] to double** + // CHECK-DAG: [[CPADDR7:%.+]] = bitcast i8** [[PADDR7]] to double** + // CHECK-DAG: store double* %{{.+}}, double** [[CBPADDR7]] + // CHECK-DAG: store double* %{{.+}}, double** [[CPADDR7]] + // CHECK-DAG: store i[[SZ]] [[CNSIZE]], i[[SZ]]* [[SADDR7]] + + // CHECK-DAG: [[CBPADDR8:%.+]] = bitcast i8** [[BPADDR8]] to [[TT]]** + // CHECK-DAG: [[CPADDR8:%.+]] = bitcast i8** [[PADDR8]] to [[TT]]** + // CHECK-DAG: store [[TT]]* %{{.+}}, [[TT]]** [[CBPADDR8]] + // CHECK-DAG: store [[TT]]* %{{.+}}, [[TT]]** [[CPADDR8]] + // CHECK-DAG: store i[[SZ]] {{12|16}}, i[[SZ]]* [[SADDR8]] // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 // CHECK: [[RET2:%.+]] = load i32, i32* [[RHV]], align 4 @@ -468,48 +470,53 @@ int bar(int n){ // CHECK-DAG: [[BPR]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BP:%.+]], i32 0, i32 0 // CHECK-DAG: [[PR]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[P:%.+]], i32 0, i32 0 // CHECK-DAG: [[SR]] = getelementptr inbounds [5 x i[[SZ]]], [5 x i[[SZ]]]* [[S:%.+]], i32 0, i32 0 -// CHECK-DAG: [[SADDR0:%.+]] = getelementptr inbounds [5 x i[[SZ]]], [5 x i[[SZ]]]* [[S]], i32 [[IDX0:[0-9]+]] -// CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BP]], i32 [[IDX0]] -// CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[P]], i32 [[IDX0]] -// CHECK-DAG: [[SADDR1:%.+]] = getelementptr inbounds [5 x i[[SZ]]], [5 x i[[SZ]]]* [[S]], i32 [[IDX1:[0-9]+]] -// CHECK-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BP]], i32 [[IDX1]] -// CHECK-DAG: [[PADDR1:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[P]], i32 [[IDX1]] -// CHECK-DAG: [[SADDR2:%.+]] = getelementptr inbounds [5 x i[[SZ]]], [5 x i[[SZ]]]* [[S]], i32 [[IDX2:[0-9]+]] -// CHECK-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BP]], i32 [[IDX2]] -// CHECK-DAG: [[PADDR2:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[P]], i32 [[IDX2]] -// CHECK-DAG: [[SADDR3:%.+]] = getelementptr inbounds [5 x i[[SZ]]], [5 x i[[SZ]]]* [[S]], i32 [[IDX3:[0-9]+]] -// CHECK-DAG: [[BPADDR3:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BP]], i32 [[IDX3]] -// CHECK-DAG: [[PADDR3:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[P]], i32 [[IDX3]] +// CHECK-DAG: [[SADDR0:%.+]] = getelementptr inbounds [5 x i[[SZ]]], [5 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX0:0]] +// CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BP]], i32 0, i32 [[IDX0]] +// CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[P]], i32 0, i32 [[IDX0]] +// CHECK-DAG: [[SADDR1:%.+]] = getelementptr inbounds [5 x i[[SZ]]], [5 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX1:1]] +// CHECK-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BP]], i32 0, i32 [[IDX1]] +// CHECK-DAG: [[PADDR1:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[P]], i32 0, i32 [[IDX1]] +// CHECK-DAG: [[SADDR2:%.+]] = getelementptr inbounds [5 x i[[SZ]]], [5 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX2:2]] +// CHECK-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BP]], i32 0, i32 [[IDX2]] +// CHECK-DAG: [[PADDR2:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[P]], i32 0, i32 [[IDX2]] +// CHECK-DAG: [[SADDR3:%.+]] = getelementptr inbounds [5 x i[[SZ]]], [5 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX3:3]] +// CHECK-DAG: [[BPADDR3:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BP]], i32 0, i32 [[IDX3]] +// CHECK-DAG: [[PADDR3:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[P]], i32 0, i32 [[IDX3]] +// CHECK-DAG: [[SADDR4:%.+]] = getelementptr inbounds [5 x i[[SZ]]], [5 x i[[SZ]]]* [[S]], i32 0, i32 [[IDX4:4]] +// CHECK-DAG: [[BPADDR4:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BP]], i32 0, i32 [[IDX4]] +// CHECK-DAG: [[PADDR4:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[P]], i32 0, i32 [[IDX4]] // The names below are not necessarily consistent with the names used for the // addresses above as some are repeated. -// CHECK-DAG: [[BP0:%[^,]+]] = inttoptr i[[SZ]] [[VLA0]] to i8* -// CHECK-DAG: [[P0:%[^,]+]] = inttoptr i[[SZ]] [[VLA0]] to i8* -// CHECK-DAG: store i8* [[BP0]], i8** {{%[^,]+}} -// CHECK-DAG: store i8* [[P0]], i8** {{%[^,]+}} -// CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* {{%[^,]+}} - -// CHECK-DAG: store i8* inttoptr (i[[SZ]] 2 to i8*), i8** {{%[^,]+}} -// CHECK-DAG: store i8* inttoptr (i[[SZ]] 2 to i8*), i8** {{%[^,]+}} -// CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* {{%[^,]+}} - -// CHECK-DAG: [[BP2:%[^,]+]] = inttoptr i[[SZ]] [[B_CVAL]] to i8* -// CHECK-DAG: [[P2:%[^,]+]] = inttoptr i[[SZ]] [[B_CVAL]] to i8* -// CHECK-DAG: store i8* [[BP2]], i8** {{%[^,]+}} -// CHECK-DAG: store i8* [[P2]], i8** {{%[^,]+}} -// CHECK-DAG: store i[[SZ]] 4, i[[SZ]]* {{%[^,]+}} - -// CHECK-DAG: [[BP3:%[^,]+]] = bitcast [[S1]]* %{{.+}} to i8* -// CHECK-DAG: [[P3:%[^,]+]] = bitcast [[S1]]* %{{.+}} to i8* -// CHECK-DAG: store i8* [[BP3]], i8** {{%[^,]+}} -// CHECK-DAG: store i8* [[P3]], i8** {{%[^,]+}} -// CHECK-DAG: store i[[SZ]] 8, i[[SZ]]* {{%[^,]+}} - -// CHECK-DAG: [[BP4:%[^,]+]] = bitcast i16* %{{.+}} to i8* -// CHECK-DAG: [[P4:%[^,]+]] = bitcast i16* %{{.+}} to i8* -// CHECK-DAG: store i8* [[BP4]], i8** {{%[^,]+}} -// CHECK-DAG: store i8* [[P4]], i8** {{%[^,]+}} -// CHECK-DAG: store i[[SZ]] [[CSIZE]], i[[SZ]]* {{%[^,]+}} +// CHECK-DAG: [[CBPADDR3:%.+]] = bitcast i8** [[BPADDR3]] to i[[SZ]]* +// CHECK-DAG: [[CPADDR3:%.+]] = bitcast i8** [[PADDR3]] to i[[SZ]]* +// CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CBPADDR3]] +// CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CPADDR3]] +// CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* [[SADDR3]] + +// CHECK-DAG: [[CBPADDR2:%.+]] = bitcast i8** [[BPADDR2]] to i[[SZ]]* +// CHECK-DAG: [[CPADDR2:%.+]] = bitcast i8** [[PADDR2]] to i[[SZ]]* +// CHECK-DAG: store i[[SZ]] 2, i[[SZ]]* [[CBPADDR2]] +// CHECK-DAG: store i[[SZ]] 2, i[[SZ]]* [[CPADDR2]] +// CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* [[SADDR2]] + +// CHECK-DAG: [[CBPADDR1:%.+]] = bitcast i8** [[BPADDR1]] to i[[SZ]]* +// CHECK-DAG: [[CPADDR1:%.+]] = bitcast i8** [[PADDR1]] to i[[SZ]]* +// CHECK-DAG: store i[[SZ]] [[B_CVAL]], i[[SZ]]* [[CBPADDR1]] +// CHECK-DAG: store i[[SZ]] [[B_CVAL]], i[[SZ]]* [[CPADDR1]] +// CHECK-DAG: store i[[SZ]] 4, i[[SZ]]* [[SADDR1]] + +// CHECK-DAG: [[CBPADDR0:%.+]] = bitcast i8** [[BPADDR0]] to [[S1]]** +// CHECK-DAG: [[CPADDR0:%.+]] = bitcast i8** [[PADDR0]] to [[S1]]** +// CHECK-DAG: store [[S1]]* %{{.+}}, [[S1]]** [[CBPADDR0]] +// CHECK-DAG: store [[S1]]* %{{.+}}, [[S1]]** [[CPADDR0]] +// CHECK-DAG: store i[[SZ]] 8, i[[SZ]]* [[SADDR0]] + +// CHECK-DAG: [[CBPADDR4:%.+]] = bitcast i8** [[BPADDR4]] to i16** +// CHECK-DAG: [[CPADDR4:%.+]] = bitcast i8** [[PADDR4]] to i16** +// CHECK-DAG: store i16* %{{.+}}, i16** [[CBPADDR4]] +// CHECK-DAG: store i16* %{{.+}}, i16** [[CPADDR4]] +// CHECK-DAG: store i[[SZ]] [[CSIZE]], i[[SZ]]* [[SADDR4]] // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 // CHECK: [[RET2:%.+]] = load i32, i32* [[RHV]], align 4 @@ -533,29 +540,31 @@ int bar(int n){ // CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[BP]], i32 0, i32 0 // CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[P]], i32 0, i32 0 -// CHECK-DAG: store i8* [[BP0:%[^,]+]], i8** [[BPADDR0]] -// CHECK-DAG: store i8* [[P0:%[^,]+]], i8** [[PADDR0]] -// CHECK-DAG: [[BP0]] = inttoptr i[[SZ]] [[VAL0:%.+]] to i8* -// CHECK-DAG: [[P0]] = inttoptr i[[SZ]] [[VAL0]] to i8* +// CHECK-DAG: [[CBPADDR0:%.+]] = bitcast i8** [[BPADDR0]] to i[[SZ]]* +// CHECK-DAG: [[CPADDR0:%.+]] = bitcast i8** [[PADDR0]] to i[[SZ]]* +// CHECK-DAG: store i[[SZ]] [[VAL0:%[^,]+]], i[[SZ]]* [[CBPADDR0]] +// CHECK-DAG: store i[[SZ]] [[VAL0]], i[[SZ]]* [[CPADDR0]] // CHECK-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[BP]], i32 0, i32 1 // CHECK-DAG: [[PADDR1:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[P]], i32 0, i32 1 -// CHECK-DAG: store i8* [[BP1:%[^,]+]], i8** [[BPADDR1]] -// CHECK-DAG: store i8* [[P1:%[^,]+]], i8** [[PADDR1]] -// CHECK-DAG: [[BP1]] = inttoptr i[[SZ]] [[VAL1:%.+]] to i8* -// CHECK-DAG: [[P1]] = inttoptr i[[SZ]] [[VAL1]] to i8* +// CHECK-DAG: [[CBPADDR1:%.+]] = bitcast i8** [[BPADDR1]] to i[[SZ]]* +// CHECK-DAG: [[CPADDR1:%.+]] = bitcast i8** [[PADDR1]] to i[[SZ]]* +// CHECK-DAG: store i[[SZ]] [[VAL1:%[^,]+]], i[[SZ]]* [[CBPADDR1]] +// CHECK-DAG: store i[[SZ]] [[VAL1]], i[[SZ]]* [[CPADDR1]] // CHECK-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[BP]], i32 0, i32 2 // CHECK-DAG: [[PADDR2:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[P]], i32 0, i32 2 -// CHECK-DAG: store i8* [[BP2:%[^,]+]], i8** [[BPADDR2]] -// CHECK-DAG: store i8* [[P2:%[^,]+]], i8** [[PADDR2]] +// CHECK-DAG: [[CBPADDR2:%.+]] = bitcast i8** [[BPADDR2]] to i[[SZ]]* +// CHECK-DAG: [[CPADDR2:%.+]] = bitcast i8** [[PADDR2]] to i[[SZ]]* +// CHECK-DAG: store i[[SZ]] [[VAL2:%[^,]+]], i[[SZ]]* [[CBPADDR2]] +// CHECK-DAG: store i[[SZ]] [[VAL2]], i[[SZ]]* [[CPADDR2]] // CHECK-DAG: [[BPADDR3:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[BP]], i32 0, i32 3 // CHECK-DAG: [[PADDR3:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[P]], i32 0, i32 3 -// CHECK-DAG: store i8* [[BP3:%[^,]+]], i8** [[BPADDR3]] -// CHECK-DAG: store i8* [[P3:%[^,]+]], i8** [[PADDR3]] -// CHECK-DAG: [[BP3]] = bitcast [10 x i32]* %{{.+}} to i8* -// CHECK-DAG: [[P3]] = bitcast [10 x i32]* %{{.+}} to i8* +// CHECK-DAG: [[CBPADDR3:%.+]] = bitcast i8** [[BPADDR3]] to [10 x i32]** +// CHECK-DAG: [[CPADDR3:%.+]] = bitcast i8** [[PADDR3]] to [10 x i32]** +// CHECK-DAG: store [10 x i32]* [[VAL3:%[^,]+]], [10 x i32]** [[CBPADDR3]] +// CHECK-DAG: store [10 x i32]* [[VAL3]], [10 x i32]** [[CPADDR3]] // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 // CHECK-NEXT: br label %[[IFEND:.+]] @@ -585,24 +594,24 @@ int bar(int n){ // CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BP]], i32 0, i32 0 // CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[P]], i32 0, i32 0 -// CHECK-DAG: store i8* [[BP0:%[^,]+]], i8** [[BPADDR0]] -// CHECK-DAG: store i8* [[P0:%[^,]+]], i8** [[PADDR0]] -// CHECK-DAG: [[BP0]] = inttoptr i[[SZ]] [[VAL0:%.+]] to i8* -// CHECK-DAG: [[P0]] = inttoptr i[[SZ]] [[VAL0]] to i8* +// CHECK-DAG: [[CBPADDR0:%.+]] = bitcast i8** [[BPADDR0]] to i[[SZ]]* +// CHECK-DAG: [[CPADDR0:%.+]] = bitcast i8** [[PADDR0]] to i[[SZ]]* +// CHECK-DAG: store i[[SZ]] [[VAL0:%[^,]+]], i[[SZ]]* [[CBPADDR0]] +// CHECK-DAG: store i[[SZ]] [[VAL0]], i[[SZ]]* [[CPADDR0]] // CHECK-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BP]], i32 0, i32 1 // CHECK-DAG: [[PADDR1:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[P]], i32 0, i32 1 -// CHECK-DAG: store i8* [[BP1:%[^,]+]], i8** [[BPADDR1]] -// CHECK-DAG: store i8* [[P1:%[^,]+]], i8** [[PADDR1]] -// CHECK-DAG: [[BP1]] = inttoptr i[[SZ]] [[VAL1:%.+]] to i8* -// CHECK-DAG: [[P1]] = inttoptr i[[SZ]] [[VAL1]] to i8* +// CHECK-DAG: [[CBPADDR1:%.+]] = bitcast i8** [[BPADDR1]] to i[[SZ]]* +// CHECK-DAG: [[CPADDR1:%.+]] = bitcast i8** [[PADDR1]] to i[[SZ]]* +// CHECK-DAG: store i[[SZ]] [[VAL1:%[^,]+]], i[[SZ]]* [[CBPADDR1]] +// CHECK-DAG: store i[[SZ]] [[VAL1]], i[[SZ]]* [[CPADDR1]] // CHECK-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BP]], i32 0, i32 2 // CHECK-DAG: [[PADDR2:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[P]], i32 0, i32 2 -// CHECK-DAG: store i8* [[BP2:%[^,]+]], i8** [[BPADDR2]] -// CHECK-DAG: store i8* [[P2:%[^,]+]], i8** [[PADDR2]] -// CHECK-DAG: [[BP2]] = bitcast [10 x i32]* %{{.+}} to i8* -// CHECK-DAG: [[P2]] = bitcast [10 x i32]* %{{.+}} to i8* +// CHECK-DAG: [[CBPADDR2:%.+]] = bitcast i8** [[BPADDR2]] to [10 x i32]** +// CHECK-DAG: [[CPADDR2:%.+]] = bitcast i8** [[PADDR2]] to [10 x i32]** +// CHECK-DAG: store [10 x i32]* [[VAL2:%[^,]+]], [10 x i32]** [[CBPADDR2]] +// CHECK-DAG: store [10 x i32]* [[VAL2]], [10 x i32]** [[CPADDR2]] // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 // CHECK-NEXT: br label %[[IFEND:.+]] diff --git a/test/OpenMP/target_codegen_global_capture.cpp b/test/OpenMP/target_codegen_global_capture.cpp index b08bf10f9f29..eb34082b2940 100644 --- a/test/OpenMP/target_codegen_global_capture.cpp +++ b/test/OpenMP/target_codegen_global_capture.cpp @@ -36,10 +36,10 @@ double Gd = 4.0; // CHECK-SAME: i16 {{[^,]*}}[[B:%[^,]+]], // CHECK-SAME: i16 {{[^,]*}}[[C:%[^,]+]], // CHECK-SAME: i16 {{[^,]*}}[[D:%[^,]+]]) -// CHECK: [[LA:%.+]] = alloca i16 -// CHECK: [[LB:%.+]] = alloca i16 -// CHECK: [[LC:%.+]] = alloca i16 -// CHECK: [[LD:%.+]] = alloca i16 +// CHECK: [[LA:%.+]] = alloca i16, +// CHECK: [[LB:%.+]] = alloca i16, +// CHECK: [[LC:%.+]] = alloca i16, +// CHECK: [[LD:%.+]] = alloca i16, int foo(short a, short b, short c, short d){ static float Sa = 5.0; static float Sb = 6.0; @@ -61,22 +61,22 @@ int foo(short a, short b, short c, short d){ // CHECK-DAG: store i16 [[VALLB]], i16* [[CONVLB:%.+]], // CHECK-DAG: [[CONVLB]] = bitcast i[[sz:64|32]]* [[CADDRLB:%.+]] to i16* // CHECK-DAG: [[CVALLB:%.+]] = load i[[sz]], i[[sz]]* [[CADDRLB]], - // CHECK-DAG: [[CPTRLB:%.+]] = inttoptr i[[sz]] [[CVALLB]] to i8* - // CHECK-DAG: store i8* [[CPTRLB]], i8** [[GEPLB:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALLB]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPLB:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPLB]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-DAG: store i16 [[VALLC]], i16* [[CONVLC:%.+]], // CHECK-DAG: [[CONVLC]] = bitcast i[[sz]]* [[CADDRLC:%.+]] to i16* // CHECK-DAG: [[CVALLC:%.+]] = load i[[sz]], i[[sz]]* [[CADDRLC]], - // CHECK-DAG: [[CPTRLC:%.+]] = inttoptr i[[sz]] [[CVALLC]] to i8* - // CHECK-DAG: store i8* [[CPTRLC]], i8** [[GEPLC:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALLC]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPLC:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPLC]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-DAG: store i16 [[VALLD]], i16* [[CONVLD:%.+]], // CHECK-DAG: [[CONVLD]] = bitcast i[[sz]]* [[CADDRLD:%.+]] to i16* // CHECK-DAG: [[CVALLD:%.+]] = load i[[sz]], i[[sz]]* [[CADDRLD]], - // CHECK-DAG: [[CPTRLD:%.+]] = inttoptr i[[sz]] [[CVALLD]] to i8* - // CHECK-DAG: store i8* [[CPTRLD]], i8** [[GEPLD:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALLD]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPLD:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPLD]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // 3 static vars being captured. @@ -84,22 +84,22 @@ int foo(short a, short b, short c, short d){ // CHECK-DAG: store float [[VALFB]], float* [[CONVFB:%.+]], // CHECK-DAG: [[CONVFB]] = bitcast i[[sz]]* [[CADDRFB:%.+]] to float* // CHECK-DAG: [[CVALFB:%.+]] = load i[[sz]], i[[sz]]* [[CADDRFB]], - // CHECK-DAG: [[CPTRFB:%.+]] = inttoptr i[[sz]] [[CVALFB]] to i8* - // CHECK-DAG: store i8* [[CPTRFB]], i8** [[GEPFB:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALFB]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPFB:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPFB]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-DAG: store float [[VALFC]], float* [[CONVFC:%.+]], // CHECK-DAG: [[CONVFC]] = bitcast i[[sz]]* [[CADDRFC:%.+]] to float* // CHECK-DAG: [[CVALFC:%.+]] = load i[[sz]], i[[sz]]* [[CADDRFC]], - // CHECK-DAG: [[CPTRFC:%.+]] = inttoptr i[[sz]] [[CVALFC]] to i8* - // CHECK-DAG: store i8* [[CPTRFC]], i8** [[GEPFC:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALFC]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPFC:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPFC]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-DAG: store float [[VALFD]], float* [[CONVFD:%.+]], // CHECK-DAG: [[CONVFD]] = bitcast i[[sz]]* [[CADDRFD:%.+]] to float* // CHECK-DAG: [[CVALFD:%.+]] = load i[[sz]], i[[sz]]* [[CADDRFD]], - // CHECK-DAG: [[CPTRFD:%.+]] = inttoptr i[[sz]] [[CVALFD]] to i8* - // CHECK-DAG: store i8* [[CPTRFD]], i8** [[GEPFD:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALFD]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPFD:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPFD]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // 3 static global vars being captured. @@ -107,25 +107,28 @@ int foo(short a, short b, short c, short d){ // CHECK-64-DAG: store double [[VALGB]], double* [[CONVGB:%.+]], // CHECK-64-DAG: [[CONVGB]] = bitcast i[[sz]]* [[CADDRGB:%.+]] to double* // CHECK-64-DAG: [[CVALGB:%.+]] = load i[[sz]], i[[sz]]* [[CADDRGB]], - // CHECK-64-DAG: [[CPTRGB:%.+]] = inttoptr i[[sz]] [[CVALGB]] to i8* - // CHECK-64-DAG: store i8* [[CPTRGB]], i8** [[GEPGB:%.+]], - // CHECK-32-DAG: store i8* bitcast (double* @Gb to i8*), i8** [[GEPGB:%.+]], + // CHECK-64-DAG: store i[[sz]] [[CVALGB]], i[[sz]]* [[CBP:%.+]], + // CHECK-64-DAG: [[CBP]] = bitcast i8** [[GEPGB:%.+]] to i[[sz]]* + // CHECK-32-DAG: store double* @Gb, double** [[CBP:%.+]], + // CHECK-32-DAG: [[CBP]] = bitcast i8** [[GEPGB:%.+]] to double** // CHECK-DAG: [[GEPGB]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-64-DAG: store double [[VALGC]], double* [[CONVGC:%.+]], // CHECK-64-DAG: [[CONVGC]] = bitcast i[[sz]]* [[CADDRGC:%.+]] to double* // CHECK-64-DAG: [[CVALGC:%.+]] = load i[[sz]], i[[sz]]* [[CADDRGC]], - // CHECK-64-DAG: [[CPTRGC:%.+]] = inttoptr i[[sz]] [[CVALGC]] to i8* - // CHECK-64-DAG: store i8* [[CPTRGC]], i8** [[GEPGC:%.+]], - // CHECK-32-DAG: store i8* bitcast (double* @Gc to i8*), i8** [[GEPGC:%.+]], + // CHECK-64-DAG: store i[[sz]] [[CVALGC]], i[[sz]]* [[CBP:%.+]], + // CHECK-64-DAG: [[CBP]] = bitcast i8** [[GEPGC:%.+]] to i[[sz]]* + // CHECK-32-DAG: store double* @Gc, double** [[CBP:%.+]], + // CHECK-32-DAG: [[CBP]] = bitcast i8** [[GEPGC:%.+]] to double** // CHECK-DAG: [[GEPGC]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-64-DAG: store double [[VALGD]], double* [[CONVGD:%.+]], // CHECK-64-DAG: [[CONVGD]] = bitcast i[[sz]]* [[CADDRGD:%.+]] to double* // CHECK-64-DAG: [[CVALGD:%.+]] = load i[[sz]], i[[sz]]* [[CADDRGD]], - // CHECK-64-DAG: [[CPTRGD:%.+]] = inttoptr i[[sz]] [[CVALGD]] to i8* - // CHECK-64-DAG: store i8* [[CPTRGD]], i8** [[GEPGD:%.+]], - // CHECK-32-DAG: store i8* bitcast (double* @Gd to i8*), i8** [[GEPGD:%.+]], + // CHECK-64-DAG: store i[[sz]] [[CVALGD]], i[[sz]]* [[CBP:%.+]], + // CHECK-64-DAG: [[CBP]] = bitcast i8** [[GEPGD:%.+]] to i[[sz]]* + // CHECK-32-DAG: store double* @Gd, double** [[CBP:%.+]], + // CHECK-32-DAG: [[CBP]] = bitcast i8** [[GEPGD:%.+]] to double** // CHECK-DAG: [[GEPGD]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK: call i32 @__tgt_target @@ -197,22 +200,22 @@ int bar(short a, short b, short c, short d){ // CHECK-DAG: store i16 [[VALLB]], i16* [[CONVLB:%.+]], // CHECK-DAG: [[CONVLB]] = bitcast i[[sz:64|32]]* [[CADDRLB:%.+]] to i16* // CHECK-DAG: [[CVALLB:%.+]] = load i[[sz]], i[[sz]]* [[CADDRLB]], - // CHECK-DAG: [[CPTRLB:%.+]] = inttoptr i[[sz]] [[CVALLB]] to i8* - // CHECK-DAG: store i8* [[CPTRLB]], i8** [[GEPLB:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALLB]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPLB:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPLB]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-DAG: store i16 [[VALLC]], i16* [[CONVLC:%.+]], // CHECK-DAG: [[CONVLC]] = bitcast i[[sz]]* [[CADDRLC:%.+]] to i16* // CHECK-DAG: [[CVALLC:%.+]] = load i[[sz]], i[[sz]]* [[CADDRLC]], - // CHECK-DAG: [[CPTRLC:%.+]] = inttoptr i[[sz]] [[CVALLC]] to i8* - // CHECK-DAG: store i8* [[CPTRLC]], i8** [[GEPLC:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALLC]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPLC:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPLC]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-DAG: store i16 [[VALLD]], i16* [[CONVLD:%.+]], // CHECK-DAG: [[CONVLD]] = bitcast i[[sz]]* [[CADDRLD:%.+]] to i16* // CHECK-DAG: [[CVALLD:%.+]] = load i[[sz]], i[[sz]]* [[CADDRLD]], - // CHECK-DAG: [[CPTRLD:%.+]] = inttoptr i[[sz]] [[CVALLD]] to i8* - // CHECK-DAG: store i8* [[CPTRLD]], i8** [[GEPLD:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALLD]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPLD:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPLD]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // 3 static vars being captured. @@ -220,22 +223,22 @@ int bar(short a, short b, short c, short d){ // CHECK-DAG: store float [[VALFB]], float* [[CONVFB:%.+]], // CHECK-DAG: [[CONVFB]] = bitcast i[[sz]]* [[CADDRFB:%.+]] to float* // CHECK-DAG: [[CVALFB:%.+]] = load i[[sz]], i[[sz]]* [[CADDRFB]], - // CHECK-DAG: [[CPTRFB:%.+]] = inttoptr i[[sz]] [[CVALFB]] to i8* - // CHECK-DAG: store i8* [[CPTRFB]], i8** [[GEPFB:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALFB]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPFB:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPFB]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-DAG: store float [[VALFC]], float* [[CONVFC:%.+]], // CHECK-DAG: [[CONVFC]] = bitcast i[[sz]]* [[CADDRFC:%.+]] to float* // CHECK-DAG: [[CVALFC:%.+]] = load i[[sz]], i[[sz]]* [[CADDRFC]], - // CHECK-DAG: [[CPTRFC:%.+]] = inttoptr i[[sz]] [[CVALFC]] to i8* - // CHECK-DAG: store i8* [[CPTRFC]], i8** [[GEPFC:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALFC]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPFC:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPFC]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-DAG: store float [[VALFD]], float* [[CONVFD:%.+]], // CHECK-DAG: [[CONVFD]] = bitcast i[[sz]]* [[CADDRFD:%.+]] to float* // CHECK-DAG: [[CVALFD:%.+]] = load i[[sz]], i[[sz]]* [[CADDRFD]], - // CHECK-DAG: [[CPTRFD:%.+]] = inttoptr i[[sz]] [[CVALFD]] to i8* - // CHECK-DAG: store i8* [[CPTRFD]], i8** [[GEPFD:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALFD]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPFD:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPFD]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // 3 static global vars being captured. @@ -243,25 +246,28 @@ int bar(short a, short b, short c, short d){ // CHECK-64-DAG: store double [[VALGB]], double* [[CONVGB:%.+]], // CHECK-64-DAG: [[CONVGB]] = bitcast i[[sz]]* [[CADDRGB:%.+]] to double* // CHECK-64-DAG: [[CVALGB:%.+]] = load i[[sz]], i[[sz]]* [[CADDRGB]], - // CHECK-64-DAG: [[CPTRGB:%.+]] = inttoptr i[[sz]] [[CVALGB]] to i8* - // CHECK-64-DAG: store i8* [[CPTRGB]], i8** [[GEPGB:%.+]], - // CHECK-32-DAG: store i8* bitcast (double* @Gb to i8*), i8** [[GEPGB:%.+]], + // CHECK-64-DAG: store i[[sz]] [[CVALGB]], i[[sz]]* [[CBP:%.+]], + // CHECK-64-DAG: [[CBP]] = bitcast i8** [[GEPGB:%.+]] to i[[sz]]* + // CHECK-32-DAG: store double* @Gb, double** [[CBP:%.+]], + // CHECK-32-DAG: [[CBP]] = bitcast i8** [[GEPGB:%.+]] to double** // CHECK-DAG: [[GEPGB]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-64-DAG: store double [[VALGC]], double* [[CONVGC:%.+]], // CHECK-64-DAG: [[CONVGC]] = bitcast i[[sz]]* [[CADDRGC:%.+]] to double* // CHECK-64-DAG: [[CVALGC:%.+]] = load i[[sz]], i[[sz]]* [[CADDRGC]], - // CHECK-64-DAG: [[CPTRGC:%.+]] = inttoptr i[[sz]] [[CVALGC]] to i8* - // CHECK-64-DAG: store i8* [[CPTRGC]], i8** [[GEPGC:%.+]], - // CHECK-32-DAG: store i8* bitcast (double* @Gc to i8*), i8** [[GEPGC:%.+]], + // CHECK-64-DAG: store i[[sz]] [[CVALGC]], i[[sz]]* [[CBP:%.+]], + // CHECK-64-DAG: [[CBP]] = bitcast i8** [[GEPGC:%.+]] to i[[sz]]* + // CHECK-32-DAG: store double* @Gc, double** [[CBP:%.+]], + // CHECK-32-DAG: [[CBP]] = bitcast i8** [[GEPGC:%.+]] to double** // CHECK-DAG: [[GEPGC]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-64-DAG: store double [[VALGD]], double* [[CONVGD:%.+]], // CHECK-64-DAG: [[CONVGD]] = bitcast i[[sz]]* [[CADDRGD:%.+]] to double* // CHECK-64-DAG: [[CVALGD:%.+]] = load i[[sz]], i[[sz]]* [[CADDRGD]], - // CHECK-64-DAG: [[CPTRGD:%.+]] = inttoptr i[[sz]] [[CVALGD]] to i8* - // CHECK-64-DAG: store i8* [[CPTRGD]], i8** [[GEPGD:%.+]], - // CHECK-32-DAG: store i8* bitcast (double* @Gd to i8*), i8** [[GEPGD:%.+]], + // CHECK-64-DAG: store i[[sz]] [[CVALGD]], i[[sz]]* [[CBP:%.+]], + // CHECK-64-DAG: [[CBP]] = bitcast i8** [[GEPGD:%.+]] to i[[sz]]* + // CHECK-32-DAG: store double* @Gd, double** [[CBP:%.+]], + // CHECK-32-DAG: [[CBP]] = bitcast i8** [[GEPGD:%.+]] to double** // CHECK-DAG: [[GEPGD]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK: call i32 @__tgt_target @@ -339,22 +345,22 @@ int tbar(T a, T b, T c, T d){ // CHECK-DAG: store i16 [[VALLB]], i16* [[CONVLB:%.+]], // CHECK-DAG: [[CONVLB]] = bitcast i[[sz:64|32]]* [[CADDRLB:%.+]] to i16* // CHECK-DAG: [[CVALLB:%.+]] = load i[[sz]], i[[sz]]* [[CADDRLB]], - // CHECK-DAG: [[CPTRLB:%.+]] = inttoptr i[[sz]] [[CVALLB]] to i8* - // CHECK-DAG: store i8* [[CPTRLB]], i8** [[GEPLB:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALLB]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPLB:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPLB]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-DAG: store i16 [[VALLC]], i16* [[CONVLC:%.+]], // CHECK-DAG: [[CONVLC]] = bitcast i[[sz]]* [[CADDRLC:%.+]] to i16* // CHECK-DAG: [[CVALLC:%.+]] = load i[[sz]], i[[sz]]* [[CADDRLC]], - // CHECK-DAG: [[CPTRLC:%.+]] = inttoptr i[[sz]] [[CVALLC]] to i8* - // CHECK-DAG: store i8* [[CPTRLC]], i8** [[GEPLC:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALLC]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPLC:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPLC]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-DAG: store i16 [[VALLD]], i16* [[CONVLD:%.+]], // CHECK-DAG: [[CONVLD]] = bitcast i[[sz]]* [[CADDRLD:%.+]] to i16* // CHECK-DAG: [[CVALLD:%.+]] = load i[[sz]], i[[sz]]* [[CADDRLD]], - // CHECK-DAG: [[CPTRLD:%.+]] = inttoptr i[[sz]] [[CVALLD]] to i8* - // CHECK-DAG: store i8* [[CPTRLD]], i8** [[GEPLD:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALLD]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPLD:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPLD]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // 3 static vars being captured. @@ -362,22 +368,22 @@ int tbar(T a, T b, T c, T d){ // CHECK-DAG: store float [[VALFB]], float* [[CONVFB:%.+]], // CHECK-DAG: [[CONVFB]] = bitcast i[[sz]]* [[CADDRFB:%.+]] to float* // CHECK-DAG: [[CVALFB:%.+]] = load i[[sz]], i[[sz]]* [[CADDRFB]], - // CHECK-DAG: [[CPTRFB:%.+]] = inttoptr i[[sz]] [[CVALFB]] to i8* - // CHECK-DAG: store i8* [[CPTRFB]], i8** [[GEPFB:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALFB]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPFB:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPFB]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-DAG: store float [[VALFC]], float* [[CONVFC:%.+]], // CHECK-DAG: [[CONVFC]] = bitcast i[[sz]]* [[CADDRFC:%.+]] to float* // CHECK-DAG: [[CVALFC:%.+]] = load i[[sz]], i[[sz]]* [[CADDRFC]], - // CHECK-DAG: [[CPTRFC:%.+]] = inttoptr i[[sz]] [[CVALFC]] to i8* - // CHECK-DAG: store i8* [[CPTRFC]], i8** [[GEPFC:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALFC]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPFC:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPFC]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-DAG: store float [[VALFD]], float* [[CONVFD:%.+]], // CHECK-DAG: [[CONVFD]] = bitcast i[[sz]]* [[CADDRFD:%.+]] to float* // CHECK-DAG: [[CVALFD:%.+]] = load i[[sz]], i[[sz]]* [[CADDRFD]], - // CHECK-DAG: [[CPTRFD:%.+]] = inttoptr i[[sz]] [[CVALFD]] to i8* - // CHECK-DAG: store i8* [[CPTRFD]], i8** [[GEPFD:%.+]], + // CHECK-DAG: store i[[sz]] [[CVALFD]], i[[sz]]* [[CBP:%.+]], + // CHECK-DAG: [[CBP]] = bitcast i8** [[GEPFD:%.+]] to i[[sz]]* // CHECK-DAG: [[GEPFD]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // 3 static global vars being captured. @@ -385,25 +391,28 @@ int tbar(T a, T b, T c, T d){ // CHECK-64-DAG: store double [[VALGB]], double* [[CONVGB:%.+]], // CHECK-64-DAG: [[CONVGB]] = bitcast i[[sz]]* [[CADDRGB:%.+]] to double* // CHECK-64-DAG: [[CVALGB:%.+]] = load i[[sz]], i[[sz]]* [[CADDRGB]], - // CHECK-64-DAG: [[CPTRGB:%.+]] = inttoptr i[[sz]] [[CVALGB]] to i8* - // CHECK-64-DAG: store i8* [[CPTRGB]], i8** [[GEPGB:%.+]], - // CHECK-32-DAG: store i8* bitcast (double* @Gb to i8*), i8** [[GEPGB:%.+]], + // CHECK-64-DAG: store i[[sz]] [[CVALGB]], i[[sz]]* [[CBP:%.+]], + // CHECK-64-DAG: [[CBP]] = bitcast i8** [[GEPGB:%.+]] to i[[sz]]* + // CHECK-32-DAG: store double* @Gb, double** [[CBP:%.+]], + // CHECK-32-DAG: [[CBP]] = bitcast i8** [[GEPGB:%.+]] to double** // CHECK-DAG: [[GEPGB]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-64-DAG: store double [[VALGC]], double* [[CONVGC:%.+]], // CHECK-64-DAG: [[CONVGC]] = bitcast i[[sz]]* [[CADDRGC:%.+]] to double* // CHECK-64-DAG: [[CVALGC:%.+]] = load i[[sz]], i[[sz]]* [[CADDRGC]], - // CHECK-64-DAG: [[CPTRGC:%.+]] = inttoptr i[[sz]] [[CVALGC]] to i8* - // CHECK-64-DAG: store i8* [[CPTRGC]], i8** [[GEPGC:%.+]], - // CHECK-32-DAG: store i8* bitcast (double* @Gc to i8*), i8** [[GEPGC:%.+]], + // CHECK-64-DAG: store i[[sz]] [[CVALGC]], i[[sz]]* [[CBP:%.+]], + // CHECK-64-DAG: [[CBP]] = bitcast i8** [[GEPGC:%.+]] to i[[sz]]* + // CHECK-32-DAG: store double* @Gc, double** [[CBP:%.+]], + // CHECK-32-DAG: [[CBP]] = bitcast i8** [[GEPGC:%.+]] to double** // CHECK-DAG: [[GEPGC]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK-64-DAG: store double [[VALGD]], double* [[CONVGD:%.+]], // CHECK-64-DAG: [[CONVGD]] = bitcast i[[sz]]* [[CADDRGD:%.+]] to double* // CHECK-64-DAG: [[CVALGD:%.+]] = load i[[sz]], i[[sz]]* [[CADDRGD]], - // CHECK-64-DAG: [[CPTRGD:%.+]] = inttoptr i[[sz]] [[CVALGD]] to i8* - // CHECK-64-DAG: store i8* [[CPTRGD]], i8** [[GEPGD:%.+]], - // CHECK-32-DAG: store i8* bitcast (double* @Gd to i8*), i8** [[GEPGD:%.+]], + // CHECK-64-DAG: store i[[sz]] [[CVALGD]], i[[sz]]* [[CBP:%.+]], + // CHECK-64-DAG: [[CBP]] = bitcast i8** [[GEPGD:%.+]] to i[[sz]]* + // CHECK-32-DAG: store double* @Gd, double** [[CBP:%.+]], + // CHECK-32-DAG: [[CBP]] = bitcast i8** [[GEPGD:%.+]] to double** // CHECK-DAG: [[GEPGD]] = getelementptr inbounds [9 x i8*], [9 x i8*]* %{{.+}}, i32 0, i32 {{[0-8]}} // CHECK: call i32 @__tgt_target diff --git a/test/OpenMP/target_data_codegen.cpp b/test/OpenMP/target_data_codegen.cpp index a149ba9332b9..7e5e267d13b6 100644 --- a/test/OpenMP/target_data_codegen.cpp +++ b/test/OpenMP/target_data_codegen.cpp @@ -45,8 +45,10 @@ void foo(int arg) { // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK1-DAG: store i8* bitcast ([100 x double]* @gc to i8*), i8** [[BP0]] - // CK1-DAG: store i8* bitcast ([100 x double]* @gc to i8*), i8** [[P0]] + // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x double]** + // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [100 x double]** + // CK1-DAG: store [100 x double]* @gc, [100 x double]** [[CBP0]] + // CK1-DAG: store [100 x double]* @gc, [100 x double]** [[CP0]] // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1 @@ -71,10 +73,10 @@ void foo(int arg) { // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK1-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK1-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK1-DAG: [[CBPVAL0]] = bitcast i32* [[VAR0:%.+]] to i8* - // CK1-DAG: [[CPVAL0]] = bitcast i32* [[VAR0]] to i8* + // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK1-DAG: store i32* [[VAR0:%.+]], i32** [[CBP0]] + // CK1-DAG: store i32* [[VAR0]], i32** [[CP0]] // CK1: br label %[[IFEND:[^,]+]] // CK1: [[IFELSE]] @@ -103,11 +105,11 @@ void foo(int arg) { // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK1-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK1-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] + // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to float** + // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to float** + // CK1-DAG: store float* [[VAR0:%.+]], float** [[CBP0]] + // CK1-DAG: store float* [[VAR0]], float** [[CP0]] // CK1-DAG: store i[[sz]] [[CSVAL0:%[^,]+]], i[[sz]]* [[S0]] - // CK1-DAG: [[CBPVAL0]] = bitcast float* [[VAR0:%.+]] to i8* - // CK1-DAG: [[CPVAL0]] = bitcast float* [[VAR0]] to i8* // CK1-DAG: [[CSVAL0]] = mul nuw i[[sz]] %{{[^,]+}}, 4 // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1 @@ -128,15 +130,18 @@ void foo(int arg) { // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK1-DAG: store i8* bitcast ([[ST]]* @gb to i8*), i8** [[BP0]] - // CK1-DAG: store i8* bitcast (double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1) to i8*), i8** [[P0]] + // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to double*** + // CK1-DAG: store [[ST]]* @gb, [[ST]]** [[CBP0]] + // CK1-DAG: store double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1), double*** [[CP0]] // CK1-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK1-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK1-DAG: store i8* bitcast (double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1) to i8*), i8** [[BP1]] - // CK1-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK1-DAG: [[CPVAL1]] = bitcast double* [[SEC1:%.+]] to i8* + // CK1-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double*** + // CK1-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double** + // CK1-DAG: store double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1), double*** [[CBP1]] + // CK1-DAG: store double* [[SEC1:%.+]], double** [[CP1]] // CK1-DAG: [[SEC1]] = getelementptr inbounds {{.+}}double* [[SEC11:%[^,]+]], i{{.+}} 0 // CK1-DAG: [[SEC11]] = load double*, double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1), @@ -191,19 +196,19 @@ int bar(int arg){ // CK2-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK2-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK2-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK2-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK2-DAG: [[CBPVAL0]] = bitcast [[ST]]* [[VAR0:%.+]] to i8* -// CK2-DAG: [[CPVAL0]] = bitcast double** [[SEC0:%[^,]+]] to i8* +// CK2-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** +// CK2-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to double*** +// CK2-DAG: store [[ST]]* [[VAR0:%.+]], [[ST]]** [[CBP0]] +// CK2-DAG: store double** [[SEC0:%.+]], double*** [[CP0]] // CK2-DAG: [[SEC0]] = getelementptr inbounds {{.*}}[[ST]]* [[VAR0]], i32 0, i32 1 // CK2-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK2-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 -// CK2-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] -// CK2-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] -// CK2-DAG: [[CBPVAL1]] = bitcast double** [[SEC0]] to i8* -// CK2-DAG: [[CPVAL1]] = bitcast double* [[SEC1:%[^,]+]] to i8* +// CK2-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double*** +// CK2-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double** +// CK2-DAG: store double** [[SEC0]], double*** [[CBP1]] +// CK2-DAG: store double* [[SEC1:%.+]], double** [[CP1]] // CK2-DAG: [[SEC1]] = getelementptr inbounds {{.*}}double* [[SEC11:%[^,]+]], i{{.+}} 1 // CK2-DAG: [[SEC11]] = load double*, double** [[SEC111:%[^,]+]], // CK2-DAG: [[SEC111]] = getelementptr inbounds {{.*}}[[ST]]* [[VAR0]], i32 0, i32 1 diff --git a/test/OpenMP/target_data_use_device_ptr_codegen.cpp b/test/OpenMP/target_data_use_device_ptr_codegen.cpp index c4b389a4cbb8..5e275565170e 100644 --- a/test/OpenMP/target_data_use_device_ptr_codegen.cpp +++ b/test/OpenMP/target_data_use_device_ptr_codegen.cpp @@ -33,12 +33,11 @@ void foo(float *&lr, T *&tr) { float *l; T *t; - // CK1-DAG: [[RVAL:%.+]] = bitcast double* [[T:%.+]] to i8* - // CK1-DAG: [[T]] = load double*, double** [[DECL:@g]], + // CK1: [[T:%.+]] = load double*, double** [[DECL:@g]], // CK1: [[BP:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* %{{.+}}, i32 0, i32 0 - // CK1: store i8* [[RVAL]], i8** [[BP]], - // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE00]] // CK1: [[CBP:%.+]] = bitcast i8** [[BP]] to double** + // CK1: store double* [[T]], double** [[CBP]], + // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE00]] // CK1: [[VAL:%.+]] = load double*, double** [[CBP]], // CK1-NOT: store double* [[VAL]], double** [[DECL]], // CK1: store double* [[VAL]], double** [[PVT:%.+]], @@ -53,12 +52,11 @@ void foo(float *&lr, T *&tr) { // CK1: getelementptr inbounds double, double* [[TTT]], i32 1 ++g; - // CK1-DAG: [[RVAL:%.+]] = bitcast float* [[T1:%.+]] to i8* - // CK1-DAG: [[T1]] = load float*, float** [[DECL:%.+]], + // CK1: [[T1:%.+]] = load float*, float** [[DECL:%.+]], // CK1: [[BP:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* %{{.+}}, i32 0, i32 0 - // CK1: store i8* [[RVAL]], i8** [[BP]], - // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE01]] // CK1: [[CBP:%.+]] = bitcast i8** [[BP]] to float** + // CK1: store float* [[T1]], float** [[CBP]], + // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE01]] // CK1: [[VAL:%.+]] = load float*, float** [[CBP]], // CK1-NOT: store float* [[VAL]], float** [[DECL]], // CK1: store float* [[VAL]], float** [[PVT:%.+]], @@ -85,12 +83,11 @@ void foo(float *&lr, T *&tr) { // CK1: getelementptr inbounds float, float* [[TTT]], i32 1 ++l; - // CK1-DAG: [[RVAL:%.+]] = bitcast float* [[T1:%.+]] to i8* - // CK1-DAG: [[T1]] = load float*, float** [[DECL:%.+]], + // CK1: [[T1:%.+]] = load float*, float** [[DECL:%.+]], // CK1: [[BP:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* %{{.+}}, i32 0, i32 0 - // CK1: store i8* [[RVAL]], i8** [[BP]], - // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE03]] // CK1: [[CBP:%.+]] = bitcast i8** [[BP]] to float** + // CK1: store float* [[T1]], float** [[CBP]], + // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE03]] // CK1: [[VAL:%.+]] = load float*, float** [[CBP]], // CK1-NOT: store float* [[VAL]], float** [[DECL]], // CK1: store float* [[VAL]], float** [[PVT:%.+]], @@ -109,12 +106,11 @@ void foo(float *&lr, T *&tr) { // CK1: br i1 [[CMP]], label %[[BTHEN:.+]], label %[[BELSE:.+]] // CK1: [[BTHEN]]: - // CK1-DAG: [[RVAL:%.+]] = bitcast float* [[T1:%.+]] to i8* - // CK1-DAG: [[T1]] = load float*, float** [[DECL:%.+]], + // CK1: [[T1:%.+]] = load float*, float** [[DECL:%.+]], // CK1: [[BP:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* %{{.+}}, i32 0, i32 0 - // CK1: store i8* [[RVAL]], i8** [[BP]], - // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE04]] // CK1: [[CBP:%.+]] = bitcast i8** [[BP]] to float** + // CK1: store float* [[T1]], float** [[CBP]], + // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE04]] // CK1: [[VAL:%.+]] = load float*, float** [[CBP]], // CK1-NOT: store float* [[VAL]], float** [[DECL]], // CK1: store float* [[VAL]], float** [[PVT:%.+]], @@ -146,13 +142,12 @@ void foo(float *&lr, T *&tr) { // CK1: getelementptr inbounds float, float* [[TTT]], i32 1 ++l; - // CK1-DAG: [[RVAL:%.+]] = bitcast float* [[T1:%.+]] to i8* - // CK1-DAG: [[T1]] = load float*, float** [[T2:%.+]], - // CK1-DAG: [[T2]] = load float**, float*** [[DECL:%.+]], + // CK1: [[T2:%.+]] = load float**, float*** [[DECL:%.+]], + // CK1: [[T1:%.+]] = load float*, float** [[T2]], // CK1: [[BP:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* %{{.+}}, i32 0, i32 0 - // CK1: store i8* [[RVAL]], i8** [[BP]], - // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE05]] // CK1: [[CBP:%.+]] = bitcast i8** [[BP]] to float** + // CK1: store float* [[T1]], float** [[CBP]], + // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE05]] // CK1: [[VAL:%.+]] = load float*, float** [[CBP]], // CK1: store float* [[VAL]], float** [[PVTV:%.+]], // CK1-NOT: store float** [[PVTV]], float*** [[DECL]], @@ -170,12 +165,11 @@ void foo(float *&lr, T *&tr) { // CK1: getelementptr inbounds float, float* [[TTTT]], i32 1 ++lr; - // CK1-DAG: [[RVAL:%.+]] = bitcast i32* [[T1:%.+]] to i8* - // CK1-DAG: [[T1]] = load i32*, i32** [[DECL:%.+]], + // CK1: [[T1:%.+]] = load i32*, i32** [[DECL:%.+]], // CK1: [[BP:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* %{{.+}}, i32 0, i32 0 - // CK1: store i8* [[RVAL]], i8** [[BP]], - // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE06]] // CK1: [[CBP:%.+]] = bitcast i8** [[BP]] to i32** + // CK1: store i32* [[T1]], i32** [[CBP]], + // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE06]] // CK1: [[VAL:%.+]] = load i32*, i32** [[CBP]], // CK1-NOT: store i32* [[VAL]], i32** [[DECL]], // CK1: store i32* [[VAL]], i32** [[PVT:%.+]], @@ -190,13 +184,12 @@ void foo(float *&lr, T *&tr) { // CK1: getelementptr inbounds i32, i32* [[TTT]], i32 1 ++t; - // CK1-DAG: [[RVAL:%.+]] = bitcast i32* [[T1:%.+]] to i8* - // CK1-DAG: [[T1]] = load i32*, i32** [[T2:%.+]], - // CK1-DAG: [[T2]] = load i32**, i32*** [[DECL:%.+]], + // CK1: [[T2:%.+]] = load i32**, i32*** [[DECL:%.+]], + // CK1: [[T1:%.+]] = load i32*, i32** [[T2]], // CK1: [[BP:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* %{{.+}}, i32 0, i32 0 - // CK1: store i8* [[RVAL]], i8** [[BP]], - // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE07]] // CK1: [[CBP:%.+]] = bitcast i8** [[BP]] to i32** + // CK1: store i32* [[T1]], i32** [[CBP]], + // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE07]] // CK1: [[VAL:%.+]] = load i32*, i32** [[CBP]], // CK1: store i32* [[VAL]], i32** [[PVTV:%.+]], // CK1-NOT: store i32** [[PVTV]], i32*** [[DECL]], @@ -214,12 +207,11 @@ void foo(float *&lr, T *&tr) { // CK1: getelementptr inbounds i32, i32* [[TTTT]], i32 1 ++tr; - // CK1-DAG: [[RVAL:%.+]] = bitcast float* [[T1:%.+]] to i8* - // CK1-DAG: [[T1]] = load float*, float** [[DECL:%.+]], + // CK1: [[T1:%.+]] = load float*, float** [[DECL:%.+]], // CK1: [[BP:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* %{{.+}}, i32 0, i32 - // CK1: store i8* [[RVAL]], i8** [[BP]], - // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE08]] // CK1: [[CBP:%.+]] = bitcast i8** [[BP]] to float** + // CK1: store float* [[T1]], float** [[CBP]], + // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE08]] // CK1: [[VAL:%.+]] = load float*, float** [[CBP]], // CK1-NOT: store float* [[VAL]], float** [[DECL]], // CK1: store float* [[VAL]], float** [[PVT:%.+]], @@ -235,11 +227,11 @@ void foo(float *&lr, T *&tr) { ++l; ++t; - // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE09]] // CK1: [[_CBP:%.+]] = bitcast i8** {{%.+}} to float** + // CK1: [[CBP:%.+]] = bitcast i8** {{%.+}} to i32** + // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE09]] // CK1: [[_VAL:%.+]] = load float*, float** [[_CBP]], // CK1: store float* [[_VAL]], float** [[_PVT:%.+]], - // CK1: [[CBP:%.+]] = bitcast i8** {{%.+}} to i32** // CK1: [[VAL:%.+]] = load i32*, i32** [[CBP]], // CK1: store i32* [[VAL]], i32** [[PVT:%.+]], // CK1: [[_TT1:%.+]] = load float*, float** [[_PVT]], @@ -257,11 +249,11 @@ void foo(float *&lr, T *&tr) { // CK1: getelementptr inbounds i32, i32* [[TTT]], i32 1 ++l; ++t; - // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE10]] // CK1: [[_CBP:%.+]] = bitcast i8** {{%.+}} to float** + // CK1: [[CBP:%.+]] = bitcast i8** {{%.+}} to i32** + // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE10]] // CK1: [[_VAL:%.+]] = load float*, float** [[_CBP]], // CK1: store float* [[_VAL]], float** [[_PVT:%.+]], - // CK1: [[CBP:%.+]] = bitcast i8** {{%.+}} to i32** // CK1: [[VAL:%.+]] = load i32*, i32** [[CBP]], // CK1: store i32* [[VAL]], i32** [[PVT:%.+]], // CK1: [[_TT1:%.+]] = load float*, float** [[_PVT]], @@ -279,12 +271,11 @@ void foo(float *&lr, T *&tr) { // CK1: getelementptr inbounds i32, i32* [[TTT]], i32 1 ++l; ++t; - // CK1-DAG: [[RVAL:%.+]] = bitcast i32* [[T1:%.+]] to i8* - // CK1-DAG: [[T1]] = load i32*, i32** [[DECL:%.+]], + // CK1: [[T1:%.+]] = load i32*, i32** [[DECL:%.+]], // CK1: [[BP:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* %{{.+}}, i32 0, i32 0 - // CK1: store i8* [[RVAL]], i8** [[BP]], - // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE11]] // CK1: [[CBP:%.+]] = bitcast i8** [[BP]] to i32** + // CK1: store i32* [[T1]], i32** [[CBP]], + // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE11]] // CK1: [[VAL:%.+]] = load i32*, i32** [[CBP]], // CK1-NOT: store i32* [[VAL]], i32** [[DECL]], // CK1: store i32* [[VAL]], i32** [[PVT:%.+]], @@ -299,13 +290,12 @@ void foo(float *&lr, T *&tr) { // CK1: getelementptr inbounds i32, i32* [[TTT]], i32 1 ++l; ++t; - // CK1-DAG: [[RVAL:%.+]] = bitcast i32* [[T1:%.+]] to i8* - // CK1-DAG: [[T1]] = load i32*, i32** [[T2:%.+]], - // CK1-DAG: [[T2]] = load i32**, i32*** [[DECL:%.+]], + // CK1: [[T2:%.+]] = load i32**, i32*** [[DECL:%.+]], + // CK1: [[T1:%.+]] = load i32*, i32** [[T2]], // CK1: [[BP:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* %{{.+}}, i32 0, i32 0 - // CK1: store i8* [[RVAL]], i8** [[BP]], - // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE12]] // CK1: [[CBP:%.+]] = bitcast i8** [[BP]] to i32** + // CK1: store i32* [[T1]], i32** [[CBP]], + // CK1: call void @__tgt_target_data_begin{{.+}}[[MTYPE12]] // CK1: [[VAL:%.+]] = load i32*, i32** [[CBP]], // CK1: store i32* [[VAL]], i32** [[PVTV:%.+]], // CK1-NOT: store i32** [[PVTV]], i32*** [[DECL]], @@ -356,10 +346,11 @@ struct ST { int *la = 0; // CK2: [[BP:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* %{{.+}}, i32 0, i32 1 - // CK2: store i8* [[RVAL:%.+]], i8** [[BP]], + // CK2: [[CBP:%.+]] = bitcast i8** [[BP]] to double*** + // CK2: store double** [[RVAL:%.+]], double*** [[CBP]], // CK2: call void @__tgt_target_data_begin{{.+}}[[MTYPE00]] - // CK2: [[CBP:%.+]] = bitcast i8** [[BP]] to double** - // CK2: [[VAL:%.+]] = load double*, double** [[CBP]], + // CK2: [[CBP1:%.+]] = bitcast double*** [[CBP]] to double** + // CK2: [[VAL:%.+]] = load double*, double** [[CBP1]], // CK2: store double* [[VAL]], double** [[PVT:%.+]], // CK2: store double** [[PVT]], double*** [[PVT2:%.+]], // CK2: [[TT1:%.+]] = load double**, double*** [[PVT2]], @@ -376,10 +367,11 @@ struct ST { a++; // CK2: [[BP:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* %{{.+}}, i32 0, i32 2 - // CK2: store i8* [[RVAL:%.+]], i8** [[BP]], + // CK2: [[CBP:%.+]] = bitcast i8** [[BP]] to double*** + // CK2: store double** [[RVAL:%.+]], double*** [[CBP]], // CK2: call void @__tgt_target_data_begin{{.+}}[[MTYPE01]] - // CK2: [[CBP:%.+]] = bitcast i8** [[BP]] to double** - // CK2: [[VAL:%.+]] = load double*, double** [[CBP]], + // CK2: [[CBP1:%.+]] = bitcast double*** [[CBP]] to double** + // CK2: [[VAL:%.+]] = load double*, double** [[CBP1]], // CK2: store double* [[VAL]], double** [[PVT:%.+]], // CK2: store double** [[PVT]], double*** [[PVT2:%.+]], // CK2: [[TT1:%.+]] = load double**, double*** [[PVT2]], @@ -397,9 +389,9 @@ struct ST { b++; // CK2: [[BP:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* %{{.+}}, i32 0, i32 0 - // CK2: store i8* [[RVAL:%.+]], i8** [[BP]], - // CK2: call void @__tgt_target_data_begin{{.+}}[[MTYPE02]] // CK2: [[CBP:%.+]] = bitcast i8** [[BP]] to double** + // CK2: store double* [[RVAL:%.+]], double** [[CBP]], + // CK2: call void @__tgt_target_data_begin{{.+}}[[MTYPE02]] // CK2: [[VAL:%.+]] = load double*, double** [[CBP]], // CK2: store double* [[VAL]], double** [[PVT:%.+]], // CK2: store double** [[PVT]], double*** [[PVT2:%.+]], @@ -419,16 +411,17 @@ struct ST { la++; // CK2: [[BP:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* %{{.+}}, i32 0, i32 0 - // CK2: store i8* [[RVAL:%.+]], i8** [[BP]], + // CK2: [[CBP:%.+]] = bitcast i8** [[BP]] to double** + // CK2: store double* [[RVAL:%.+]], double** [[CBP]], // CK2: [[_BP:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* %{{.+}}, i32 0, i32 3 - // CK2: store i8* [[_RVAL:%.+]], i8** [[_BP]], + // CK2: [[_CBP:%.+]] = bitcast i8** [[_BP]] to double*** + // CK2: store double** [[_RVAL:%.+]], double*** [[_CBP]], // CK2: call void @__tgt_target_data_begin{{.+}}[[MTYPE03]] - // CK2: [[CBP:%.+]] = bitcast i8** [[BP]] to double** // CK2: [[VAL:%.+]] = load double*, double** [[CBP]], // CK2: store double* [[VAL]], double** [[PVT:%.+]], // CK2: store double** [[PVT]], double*** [[PVT2:%.+]], - // CK2: [[_CBP:%.+]] = bitcast i8** [[_BP]] to double** - // CK2: [[_VAL:%.+]] = load double*, double** [[_CBP]], + // CK2: [[_CBP1:%.+]] = bitcast double*** [[_CBP]] to double** + // CK2: [[_VAL:%.+]] = load double*, double** [[_CBP1]], // CK2: store double* [[_VAL]], double** [[_PVT:%.+]], // CK2: store double** [[_PVT]], double*** [[_PVT2:%.+]], // CK2: [[TT1:%.+]] = load double**, double*** [[PVT2]], diff --git a/test/OpenMP/target_enter_data_codegen.cpp b/test/OpenMP/target_enter_data_codegen.cpp index 152cd46b4a2f..683cd976d395 100644 --- a/test/OpenMP/target_enter_data_codegen.cpp +++ b/test/OpenMP/target_enter_data_codegen.cpp @@ -45,8 +45,10 @@ void foo(int arg) { // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK1-DAG: store i8* bitcast ([100 x double]* @gc to i8*), i8** [[BP0]] - // CK1-DAG: store i8* bitcast ([100 x double]* @gc to i8*), i8** [[P0]] + // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x double]** + // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [100 x double]** + // CK1-DAG: store [100 x double]* @gc, [100 x double]** [[CBP0]] + // CK1-DAG: store [100 x double]* @gc, [100 x double]** [[CP0]] // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1 // CK1-NOT: __tgt_target_data_end @@ -67,10 +69,10 @@ void foo(int arg) { // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK1-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK1-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK1-DAG: [[CBPVAL0]] = bitcast i32* [[VAR0:%.+]] to i8* - // CK1-DAG: [[CPVAL0]] = bitcast i32* [[VAR0]] to i8* + // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK1-DAG: store i32* [[VAR0:%.+]], i32** [[CBP0]] + // CK1-DAG: store i32* [[VAR0]], i32** [[CP0]] // CK1: br label %[[IFEND:[^,]+]] // CK1: [[IFELSE]] @@ -93,11 +95,11 @@ void foo(int arg) { // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK1-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK1-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] + // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to float** + // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to float** + // CK1-DAG: store float* [[VAR0:%.+]], float** [[CBP0]] + // CK1-DAG: store float* [[VAR0]], float** [[CP0]] // CK1-DAG: store i[[sz]] [[CSVAL0:%[^,]+]], i[[sz]]* [[S0]] - // CK1-DAG: [[CBPVAL0]] = bitcast float* [[VAR0:%.+]] to i8* - // CK1-DAG: [[CPVAL0]] = bitcast float* [[VAR0]] to i8* // CK1-DAG: [[CSVAL0]] = mul nuw i[[sz]] %{{[^,]+}}, 4 // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1 // CK1-NOT: __tgt_target_data_end @@ -114,15 +116,18 @@ void foo(int arg) { // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK1-DAG: store i8* bitcast ([[ST]]* @gb to i8*), i8** [[BP0]] - // CK1-DAG: store i8* bitcast (double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1) to i8*), i8** [[P0]] + // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to double*** + // CK1-DAG: store [[ST]]* @gb, [[ST]]** [[CBP0]] + // CK1-DAG: store double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1), double*** [[CP0]] // CK1-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK1-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK1-DAG: store i8* bitcast (double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1) to i8*), i8** [[BP1]] - // CK1-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK1-DAG: [[CPVAL1]] = bitcast double* [[SEC1:%.+]] to i8* + // CK1-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double*** + // CK1-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double** + // CK1-DAG: store double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1), double*** [[CBP1]] + // CK1-DAG: store double* [[SEC1:%.+]], double** [[CP1]] // CK1-DAG: [[SEC1]] = getelementptr inbounds {{.+}}double* [[SEC11:%[^,]+]], i{{.+}} 0 // CK1-DAG: [[SEC11]] = load double*, double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1), @@ -174,19 +179,19 @@ int bar(int arg){ // CK2-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK2-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK2-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK2-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK2-DAG: [[CBPVAL0]] = bitcast [[ST]]* [[VAR0:%.+]] to i8* -// CK2-DAG: [[CPVAL0]] = bitcast double** [[SEC0:%[^,]+]] to i8* +// CK2-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** +// CK2-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to double*** +// CK2-DAG: store [[ST]]* [[VAR0:%.+]], [[ST]]** [[CBP0]] +// CK2-DAG: store double** [[SEC0:%.+]], double*** [[CP0]] // CK2-DAG: [[SEC0]] = getelementptr inbounds {{.*}}[[ST]]* [[VAR0]], i32 0, i32 1 // CK2-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK2-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 -// CK2-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] -// CK2-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] -// CK2-DAG: [[CBPVAL1]] = bitcast double** [[SEC0]] to i8* -// CK2-DAG: [[CPVAL1]] = bitcast double* [[SEC1:%[^,]+]] to i8* +// CK2-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double*** +// CK2-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double** +// CK2-DAG: store double** [[SEC0]], double*** [[CBP1]] +// CK2-DAG: store double* [[SEC1:%.+]], double** [[CP1]] // CK2-DAG: [[SEC1]] = getelementptr inbounds {{.*}}double* [[SEC11:%[^,]+]], i{{.+}} 1 // CK2-DAG: [[SEC11]] = load double*, double** [[SEC111:%[^,]+]], // CK2-DAG: [[SEC111]] = getelementptr inbounds {{.*}}[[ST]]* [[VAR0]], i32 0, i32 1 diff --git a/test/OpenMP/target_exit_data_codegen.cpp b/test/OpenMP/target_exit_data_codegen.cpp index d3a38592a610..a82c1c6c4aac 100644 --- a/test/OpenMP/target_exit_data_codegen.cpp +++ b/test/OpenMP/target_exit_data_codegen.cpp @@ -46,8 +46,10 @@ void foo(int arg) { // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK1-DAG: store i8* bitcast ([100 x double]* @gc to i8*), i8** [[BP0]] - // CK1-DAG: store i8* bitcast ([100 x double]* @gc to i8*), i8** [[P0]] + // CK1-DAG: [[BPC0:%.+]] = bitcast i8** [[BP0]] to [100 x double]** + // CK1-DAG: [[PC0:%.+]] = bitcast i8** [[P0]] to [100 x double]** + // CK1-DAG: store [100 x double]* @gc, [100 x double]** [[BPC0]] + // CK1-DAG: store [100 x double]* @gc, [100 x double]** [[PC0]] // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1 #pragma omp target exit data if(1+3-5) device(arg) map(from: gc) @@ -68,10 +70,10 @@ void foo(int arg) { // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK1-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK1-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK1-DAG: [[CBPVAL0]] = bitcast i32* [[VAR0:%.+]] to i8* - // CK1-DAG: [[CPVAL0]] = bitcast i32* [[VAR0]] to i8* + // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK1-DAG: store i32* [[VAL0:%[^,]+]], i32** [[CBP0]] + // CK1-DAG: store i32* [[VAL0]], i32** [[CP0]] // CK1: br label %[[IFEND:[^,]+]] // CK1: [[IFELSE]] @@ -94,11 +96,11 @@ void foo(int arg) { // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK1-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK1-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] + // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to float** + // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to float** + // CK1-DAG: store float* [[VAL0:%[^,]+]], float** [[CBP0]] + // CK1-DAG: store float* [[VAL0]], float** [[CP0]] // CK1-DAG: store i[[sz]] [[CSVAL0:%[^,]+]], i[[sz]]* [[S0]] - // CK1-DAG: [[CBPVAL0]] = bitcast float* [[VAR0:%.+]] to i8* - // CK1-DAG: [[CPVAL0]] = bitcast float* [[VAR0]] to i8* // CK1-DAG: [[CSVAL0]] = mul nuw i[[sz]] %{{[^,]+}}, 4 // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1 #pragma omp target exit data map(always, from: lb) @@ -115,15 +117,18 @@ void foo(int arg) { // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK1-DAG: store i8* bitcast ([[ST]]* @gb to i8*), i8** [[BP0]] - // CK1-DAG: store i8* bitcast (double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1) to i8*), i8** [[P0]] + // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to double*** + // CK1-DAG: store [[ST]]* @gb, [[ST]]** [[CBP0]] + // CK1-DAG: store double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1), double*** [[CP0]] // CK1-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK1-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK1-DAG: store i8* bitcast (double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1) to i8*), i8** [[BP1]] - // CK1-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK1-DAG: [[CPVAL1]] = bitcast double* [[SEC1:%.+]] to i8* + // CK1-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double*** + // CK1-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double** + // CK1-DAG: store double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1), double*** [[CBP1]] + // CK1-DAG: store double* [[SEC1:%[^,]+]], double** [[CP1]] // CK1-DAG: [[SEC1]] = getelementptr inbounds {{.+}}double* [[SEC11:%[^,]+]], i{{.+}} 0 // CK1-DAG: [[SEC11]] = load double*, double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1), @@ -175,19 +180,19 @@ int bar(int arg){ // CK2-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK2-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK2-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK2-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK2-DAG: [[CBPVAL0]] = bitcast [[ST]]* [[VAR0:%.+]] to i8* -// CK2-DAG: [[CPVAL0]] = bitcast double** [[SEC0:%[^,]+]] to i8* +// CK2-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** +// CK2-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to double*** +// CK2-DAG: store [[ST]]* [[VAR0:%[^,]+]], [[ST]]** [[CBP0]] +// CK2-DAG: store double** [[SEC0:%[^,]+]], double*** [[CP0]] // CK2-DAG: [[SEC0]] = getelementptr inbounds {{.*}}[[ST]]* [[VAR0]], i32 0, i32 1 // CK2-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK2-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 -// CK2-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] -// CK2-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] -// CK2-DAG: [[CBPVAL1]] = bitcast double** [[SEC0]] to i8* -// CK2-DAG: [[CPVAL1]] = bitcast double* [[SEC1:%[^,]+]] to i8* +// CK2-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double*** +// CK2-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double** +// CK2-DAG: store double** [[SEC0]], double*** [[CBP1]] +// CK2-DAG: store double* [[SEC1:%[^,]+]], double** [[CP1]] // CK2-DAG: [[SEC1]] = getelementptr inbounds {{.*}}double* [[SEC11:%[^,]+]], i{{.+}} 1 // CK2-DAG: [[SEC11]] = load double*, double** [[SEC111:%[^,]+]], // CK2-DAG: [[SEC111]] = getelementptr inbounds {{.*}}[[ST]]* [[VAR0]], i32 0, i32 1 diff --git a/test/OpenMP/target_firstprivate_codegen.cpp b/test/OpenMP/target_firstprivate_codegen.cpp index a9af2d02f237..1fb0ef9e848c 100644 --- a/test/OpenMP/target_firstprivate_codegen.cpp +++ b/test/OpenMP/target_firstprivate_codegen.cpp @@ -93,12 +93,12 @@ int foo(int n, double *ptr) { // CHECK-64: store i{{[0-9]+}} [[AVAL]], i{{[0-9]+}}* [[CONV]], // CHECK-32: store i{{[0-9]+}} [[AVAL]], i{{[0-9]+}}* [[ACAST]], // CHECK: [[ACAST_VAL:%.+]] = load i{{[0-9]+}}, i{{[0-9]+}}* [[ACAST]], - // CHECK: [[ACAST_TOPTR:%.+]] = inttoptr i{{[0-9]+}} [[ACAST_VAL]] to i8* // CHECK: [[BASE_PTR_GEP:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[BASE_PTR_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 - // CHECK: store i8* [[ACAST_TOPTR]], i8** [[BASE_PTR_GEP]], - // CHECK: [[ACAST_TOPTR2:%.+]] = inttoptr i{{[0-9]+}} [[ACAST_VAL]] to i8* + // CHECK: [[ACAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP]] to i{{[0-9]+}}* + // CHECK: store i{{[0-9]+}} [[ACAST_VAL]], i{{[0-9]+}}* [[ACAST_TOPTR]], // CHECK: [[PTR_GEP:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[PTR_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 - // CHECK: store i8* [[ACAST_TOPTR2]], i8** [[PTR_GEP]], + // CHECK: [[ACAST_TOPTR2:%.+]] = bitcast i8** [[PTR_GEP]] to i{{[0-9]+}}* + // CHECK: store i{{[0-9]+}} [[ACAST_VAL]], i{{[0-9]+}}* [[ACAST_TOPTR2]], // CHECK: [[BASE_PTR_GEP_ARG:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[BASE_PTR_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 // CHECK: [[PTR_GEP_ARG:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[PTR_ARR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 // CHECK: {{.+}} = call i32 @__tgt_target(i32 -1, {{.+}}, i32 1, i8** [[BASE_PTR_GEP_ARG]], i8** [[PTR_GEP_ARG]], i[[SZ]]* getelementptr inbounds ([1 x i[[SZ]]], [1 x i[[SZ]]]* [[SIZET]], i32 0, i32 0), i32* getelementptr inbounds ([1 x i32], [1 x i32]* [[MAPT]], i32 0, i32 0)) @@ -132,85 +132,87 @@ int foo(int n, double *ptr) { // CHECK: [[CN_SIZE_2:%.+]] = mul{{.+}} i{{[0-9]+}} [[CN_SIZE_1]], 8 // firstprivate(aa) --> base_ptr = aa, ptr = aa, size = 2 (short) - // CHECK: [[A2CAST_TO_INT:%.+]] = inttoptr i{{[0-9]+}} [[A2CAST_VAL]] to i8* // CHECK: [[BASE_PTR_GEP2_0:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BASE_PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 - // CHECK: store i8* [[A2CAST_TO_INT]], i8** [[BASE_PTR_GEP2_0]], - // CHECK: [[A2CAST_TO_INT_2:%.+]] = inttoptr i{{[0-9]+}} [[A2CAST_VAL]] to i8* + // CHECK: [[ACAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP2_0]] to i{{[0-9]+}}* + // CHECK: store i{{[0-9]+}} [[A2CAST_VAL]], i{{[0-9]+}}* [[ACAST_TOPTR]], // CHECK: [[PTR_GEP2_0:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 - // CHECK: store i8* [[A2CAST_TO_INT_2]], i8** [[PTR_GEP2_0]], + // CHECK: [[ACAST_TOPTR:%.+]] = bitcast i8** [[PTR_GEP2_0]] to i{{[0-9]+}}* + // CHECK: store i{{[0-9]+}} [[A2CAST_VAL]], i{{[0-9]+}}* [[ACAST_TOPTR]], // CHECK: [[SIZE_GEPA2:%.+]] = getelementptr inbounds [9 x i{{[0-9]+}}], [9 x i{{[0-9]+}}]* [[SIZET2]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 // CHECK: store i{{[0-9]+}} 2, i{{[0-9]+}}* [[SIZE_GEPA2]], // firstprivate(b): base_ptr = &b[0], ptr = &b[0], size = 40 (sizeof(float)*10) - // CHECK: [[BCAST:%.+]] = bitcast [10 x float]* [[B]] to i8* // CHECK: [[BASE_PTR_GEP2_1:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BASE_PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 - // CHECK: store i8* [[BCAST]], i8** [[BASE_PTR_GEP2_1]], - // CHECK: [[BCAST2:%.+]] = bitcast [10 x float]* [[B]] to i8* + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP2_1]] to [10 x float]** + // CHECK: store [10 x float]* [[B]], [10 x float]** [[BCAST_TOPTR]], // CHECK: [[PTR_GEP2_1:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 - // CHECK: store i8* [[BCAST2]], i8** [[PTR_GEP2_1]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTR_GEP2_1]] to [10 x float]** + // CHECK: store [10 x float]* [[B]], [10 x float]** [[BCAST_TOPTR]], // CHECK: [[SIZE_GEPB:%.+]] = getelementptr inbounds [9 x i{{[0-9]+}}], [9 x i{{[0-9]+}}]* [[SIZET2]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 // CHECK: store i{{[0-9]+}} 40, i{{[0-9]+}}* [[SIZE_GEPB]], // firstprivate(bn), 2 entries, n and bn: (1) base_ptr = n, ptr = n, size = 8 ; (2) base_ptr = &c[0], ptr = &c[0], size = n*sizeof(float) - // CHECK-64: [[N_EXT3_1:%.+]] = inttoptr i{{[0-9]+}} [[N_EXT]] to i8* - // CHECK-32: [[N_EXT3_1:%.+]] = inttoptr i{{[0-9]+}} [[N_ADDR_VAL]] to i8* // CHECK: [[BASE_PTR_GEP2_2:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BASE_PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 2 - // CHECK: store i8* [[N_EXT3_1]], i8** [[BASE_PTR_GEP2_2]], - // CHECK-64: [[N_EXT3_2:%.+]] = inttoptr i{{[0-9]+}} [[N_EXT]] to i8* - // CHECK-32: [[N_EXT3_2:%.+]] = inttoptr i{{[0-9]+}} [[N_ADDR_VAL]] to i8* + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP2_2]] to i{{[0-9]+}}* + // CHECK-64: store i{{[0-9]+}} [[N_EXT]], i{{[0-9]+}}* [[BCAST_TOPTR]], + // CHECK-32: store i{{[0-9]+}} [[N_ADDR_VAL]], i{{[0-9]+}}* [[BCAST_TOPTR]], // CHECK: [[PTR_GEP2_2:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 2 - // CHECK: store i8* [[N_EXT3_2]], i8** [[PTR_GEP2_2]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTR_GEP2_2]] to i{{[0-9]+}}* + // CHECK-64: store i{{[0-9]+}} [[N_EXT]], i{{[0-9]+}}* [[BCAST_TOPTR]], + // CHECK-32: store i{{[0-9]+}} [[N_ADDR_VAL]], i{{[0-9]+}}* [[BCAST_TOPTR]], // CHECK: [[SIZE_GEPBN_1:%.+]] = getelementptr inbounds [9 x i{{[0-9]+}}], [9 x i{{[0-9]+}}]* [[SIZET2]], i{{[0-9]+}} 0, i{{[0-9]+}} 2 // CHECK: store i{{[0-9]+}} {{[0-9]}}, i{{[0-9]+}}* [[SIZE_GEPBN_1]], - // CHECK: [[VLABN_BCAST:%.+]] = bitcast float* [[BN_VLA]] to i8* // CHECK: [[BASE_PTR_GEP2_3:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BASE_PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 3 - // CHECK: store i8* [[VLABN_BCAST]], i8** [[BASE_PTR_GEP2_3]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP2_3]] to float** + // CHECK: store float* [[BN_VLA]], float** [[BCAST_TOPTR]], // CHECK: [[SIZE_GEPBN_3:%.+]] = getelementptr inbounds [9 x i{{[0-9]+}}], [9 x i{{[0-9]+}}]* [[SIZET2]], i{{[0-9]+}} 0, i{{[0-9]+}} 3 // CHECK: store i{{[0-9]+}} [[BN_SIZE]], i{{[0-9]+}}* [[SIZE_GEPBN_3]] // firstprivate(c): base_ptr = &c[0], ptr = &c[0], size = 400 (5*10*sizeof(double)) - // CHECK: [[C_BCAST:%.+]] = bitcast [5 x [10 x double]]* [[C]] to i8* // CHECK: [[BASE_PTR_GEP2_4:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BASE_PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 4 - // CHECK: store i8* [[C_BCAST]], i8** [[BASE_PTR_GEP2_4]], - // CHECK: [[C_BCAST2:%.+]] = bitcast [5 x [10 x double]]* [[C]] to i8* + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP2_4]] to [5 x [10 x double]]** + // CHECK: store [5 x [10 x double]]* [[C]], [5 x [10 x double]]** [[BCAST_TOPTR]], // CHECK: [[PTR_GEP2_4:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 4 - // CHECK: store i8* [[C_BCAST2]], i8** [[PTR_GEP2_4]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTR_GEP2_4]] to [5 x [10 x double]]** + // CHECK: store [5 x [10 x double]]* [[C]], [5 x [10 x double]]** [[BCAST_TOPTR]], // CHECK: [[SIZE_GEPC_4:%.+]] = getelementptr inbounds [9 x i{{[0-9]+}}], [9 x i{{[0-9]+}}]* [[SIZET2]], i{{[0-9]+}} 0, i{{[0-9]+}} 4 // CHECK: store i{{[0-9]+}} 400, i{{[0-9]+}}* [[SIZE_GEPC_4]], // firstprivate(cn), 3 entries, 5, n, cn: (1) base_ptr = 5, ptr = 5, size = 8; (2) (1) base_ptr = n, ptr = n, size = 8; (3) base_ptr = &cn[0], ptr = &cn[0], size = 5*n*sizeof(double) // CHECK: [[BASE_PTR_GEP2_5:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BASE_PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 5 - // CHECK: store i8* inttoptr (i{{[0-9]+}} 5 to i8*), i8** [[BASE_PTR_GEP2_5]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP2_5]] to i{{[0-9]+}}* + // CHECK: store i{{[0-9]+}} 5, i{{[0-9]+}}* [[BCAST_TOPTR]], // CHECK: [[PTR_GEP2_5:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 5 - // CHECK: store i8* inttoptr (i{{[0-9]+}} 5 to i8*), i8** [[PTR_GEP2_5]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTR_GEP2_5]] to i{{[0-9]+}}* + // CHECK: store i{{[0-9]+}} 5, i{{[0-9]+}}* [[BCAST_TOPTR]], // CHECK: [[SIZE_GEPCN_5:%.+]] = getelementptr inbounds [9 x i{{[0-9]+}}], [9 x i{{[0-9]+}}]* [[SIZET2]], i{{[0-9]+}} 0, i{{[0-9]+}} 5 // CHECK: store i{{[0-9]+}} {{[0-9]}}, i{{[0-9]+}}* [[SIZE_GEPCN_5]], - // CHECK-64: [[CN_SZ_2_1:%.+]] = inttoptr i{{[0-9]+}} [[N_EXT2]] to i8* - // CHECK-32: [[CN_SZ_2_1:%.+]] = inttoptr i{{[0-9]+}} [[N_ADDR_VAL2]] to i8* // CHECK: [[BASE_PTR_GEP2_6:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BASE_PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 6 - // CHECK: store i8* [[CN_SZ_2_1]], i8** [[BASE_PTR_GEP2_6]], - // CHECK-64: [[CN_SZ_2_2:%.+]] = inttoptr i{{[0-9]+}} [[N_EXT2]] to i8* - // CHECK-32: [[CN_SZ_2_2:%.+]] = inttoptr i{{[0-9]+}} [[N_ADDR_VAL2]] to i8* + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP2_6]] to i{{[0-9]+}}* + // CHECK-64: store i{{[0-9]+}} [[N_EXT2]], i{{[0-9]+}}* [[BCAST_TOPTR]], + // CHECK-32: store i{{[0-9]+}} [[N_ADDR_VAL2]], i{{[0-9]+}}* [[BCAST_TOPTR]], // CHECK: [[PTR_GEP2_6:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 6 - // CHECK: store i8* [[CN_SZ_2_2]], i8** [[PTR_GEP2_6]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTR_GEP2_6]] to i{{[0-9]+}}* + // CHECK-64: store i{{[0-9]+}} [[N_EXT2]], i{{[0-9]+}}* [[BCAST_TOPTR]], + // CHECK-32: store i{{[0-9]+}} [[N_ADDR_VAL2]], i{{[0-9]+}}* [[BCAST_TOPTR]], // CHECK: [[SIZE_GEPCN_6:%.+]] = getelementptr inbounds [9 x i{{[0-9]+}}], [9 x i{{[0-9]+}}]* [[SIZET2]], i{{[0-9]+}} 0, i{{[0-9]+}} 6 // CHECK: store i{{[0-9]+}} {{[0-9]}}, i{{[0-9]+}}* [[SIZE_GEPCN_6]], - // CHECK: [[VLA_CN_BCAST:%.+]] = bitcast double* [[CN_VLA]] to i8* // CHECK: [[BASE_PTR_GEP2_7:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BASE_PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 7 - // CHECK: store i8* [[VLA_CN_BCAST]], i8** [[BASE_PTR_GEP2_7]], - // CHECK: [[VLA_CN_BCAST2:%.+]] = bitcast double* [[CN_VLA]] to i8* + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP2_7]] to double** + // CHECK: store double* [[CN_VLA]], double** [[BCAST_TOPTR]], // CHECK: [[PTR_GEP2_7:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 7 - // CHECK: store i8* [[VLA_CN_BCAST2]], i8** [[PTR_GEP2_7]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTR_GEP2_7]] to double** + // CHECK: store double* [[CN_VLA]], double** [[BCAST_TOPTR]], // CHECK: [[SIZE_GEPCN_7:%.+]] = getelementptr inbounds [9 x i{{[0-9]+}}], [9 x i{{[0-9]+}}]* [[SIZET2]], i{{[0-9]+}} 0, i{{[0-9]+}} 7 // CHECK: store i{{[0-9]+}} [[CN_SIZE_2]], i{{[0-9]+}}* [[SIZE_GEPCN_7]], // firstprivate(d): base_ptr = &d, ptr = &d, size = 16 - // CHECK: [[D_REF:%.+]] = bitcast [[TT]]* [[D]] to i8* // CHECK: [[BASE_PTR_GEP2_8:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[BASE_PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 8 - // CHECK: store i8* [[D_REF]], i8** [[BASE_PTR_GEP2_8]], - // CHECK: [[D_REF2:%.+]] = bitcast [[TT]]* [[D]] to i8* + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP2_8]] to [[TT]]** + // CHECK: store [[TT]]* [[D]], [[TT]]** [[BCAST_TOPTR]], // CHECK: [[PTR_GEP2_8:%.+]] = getelementptr inbounds [9 x i8*], [9 x i8*]* [[PTR_ARR2]], i{{[0-9]+}} 0, i{{[0-9]+}} 8 - // CHECK: store i8* [[D_REF2]], i8** [[PTR_GEP2_8]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTR_GEP2_8]] to [[TT]]** + // CHECK: store [[TT]]* [[D]], [[TT]]** [[BCAST_TOPTR]], // CHECK: [[SIZE_GEPCN_8:%.+]] = getelementptr inbounds [9 x i{{[0-9]+}}], [9 x i{{[0-9]+}}]* [[SIZET2]], i{{[0-9]+}} 0, i{{[0-9]+}} 8 // CHECK: store i{{[0-9]+}} {{[0-9]+}}, i{{[0-9]+}}* [[SIZE_GEPCN_8]], @@ -299,13 +301,13 @@ int foo(int n, double *ptr) { ptr[0]++; } // CHECK: [[PTR_ADDR_REF:%.+]] = load double*, double** [[PTR_ADDR]], - // CHECK: [[PTR_ADDR_BCAST:%.+]] = bitcast double* [[PTR_ADDR_REF]] to i8* // CHECK: [[BASE_PTR_GEP3_0:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[BASE_PTR_ARR3]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 - // CHECK: store i8* [[PTR_ADDR_BCAST]], i8** [[BASE_PTR_GEP3_0]], - // CHECK: [[PTR_ADDR_BCAST2:%.+]] = bitcast double* [[PTR_ADDR_REF]] to i8* + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTR_GEP3_0]] to double** + // CHECK: store double* [[PTR_ADDR_REF]], double** [[BCAST_TOPTR]], // CHECK: [[PTR_GEP3_0:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[PTR_ARR3]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 - // CHECK: store i8* [[PTR_ADDR_BCAST2]], i8** [[PTR_GEP3_0]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTR_GEP3_0]] to double** + // CHECK: store double* [[PTR_ADDR_REF]], double** [[BCAST_TOPTR]], // CHECK: [[BASE_PTR_GEP_ARG3:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[BASE_PTR_ARR3]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 // CHECK: [[PTR_GEP_ARG3:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[PTR_ARR3]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 @@ -407,38 +409,40 @@ struct S1 { // CHECK: store {{.+}}, {{.+}} // firstprivate(b): base_ptr = b, ptr = b, size = 4 (pass by-value) - // CHECK: [[B_CAST_PTR:%.+]] = inttoptr i{{[0-9]+}} [[B_CAST:%.+]] to i8* // CHECK: [[BASE_PTRS_GEP4_1:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BASE_PTRS4]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 - // CHECK: store i8* [[B_CAST_PTR]], i8** [[BASE_PTRS_GEP4_1]], - // CHECK: [[B_CAST_PTR2:%.+]] = inttoptr i{{[0-9]+}} [[B_CAST:%.+]] to i8* + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTRS_GEP4_1]] to i{{[0-9]+}}* + // CHECK: store i{{[0-9]+}} [[B_CAST:%.+]], i{{[0-9]+}}* [[BCAST_TOPTR]], // CHECK: [[PTRS_GEP4_1:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[PTRS4]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 - // CHECK: store i8* [[B_CAST_PTR2]], i8** [[PTRS_GEP4_1]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTRS_GEP4_1]] to i{{[0-9]+}}* + // CHECK: store i{{[0-9]+}} [[B_CAST]], i{{[0-9]+}}* [[BCAST_TOPTR]], // CHECK: [[SIZES_GEP4_1:%.+]] = getelementptr inbounds [5 x i{{[0-9]+}}], [5 x i{{[0-9]+}}]* [[SIZET4]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 // CHECK: store i{{[0-9]+}} 4, i{{[0-9]+}}* [[SIZES_GEP4_1]], // firstprivate(c), 3 entries: 2, n, c // CHECK: [[BASE_PTRS_GEP4_2:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BASE_PTRS4]], i{{[0-9]+}} 0, i{{[0-9]+}} 2 - // CHECK: store i8* inttoptr (i{{[0-9]+}} 2 to i8*), i8** [[BASE_PTRS_GEP4_2]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTRS_GEP4_2]] to i{{[0-9]+}}* + // CHECK: store i{{[0-9]+}} 2, i{{[0-9]+}}* [[BCAST_TOPTR]], // CHECK: [[PTRS_GEP4_2:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[PTRS4]], i{{[0-9]+}} 0, i{{[0-9]+}} 2 - // CHECK: store i8* inttoptr (i{{[0-9]+}} 2 to i8*), i8** [[PTRS_GEP4_2]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTRS_GEP4_2]] to i{{[0-9]+}}* + // CHECK: store i{{[0-9]+}} 2, i{{[0-9]+}}* [[BCAST_TOPTR]], // CHECK: [[SIZES_GEP4_2:%.+]] = getelementptr inbounds [5 x i{{[0-9]+}}], [5 x i{{[0-9]+}}]* [[SIZET4]], i{{[0-9]+}} 0, i{{[0-9]+}} 2 // CHECK-64: store i{{[0-9]+}} 8, i{{[0-9]+}}* [[SIZES_GEP4_2]], // CHECK-32: store i{{[0-9]+}} 4, i{{[0-9]+}}* [[SIZES_GEP4_2]], - // CHECK: [[N_PTR:%.+]] = inttoptr i{{[0-9]+}} [[N:%.+]] to i8* // CHECK: [[BASE_PTRS_GEP4_3:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BASE_PTRS4]], i{{[0-9]+}} 0, i{{[0-9]+}} 3 - // CHECK: store i8* [[N_PTR]], i8** [[BASE_PTRS_GEP4_3]], - // CHECK: [[N_PTR2:%.+]] = inttoptr i{{[0-9]+}} [[N:%.+]] to i8* + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTRS_GEP4_3]] to i{{[0-9]+}}* + // CHECK: store i{{[0-9]+}} [[N:%.+]], i{{[0-9]+}}* [[BCAST_TOPTR]], // CHECK: [[PTRS_GEP4_3:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[PTRS4]], i{{[0-9]+}} 0, i{{[0-9]+}} 3 - // CHECK: store i8* [[N_PTR2]], i8** [[PTRS_GEP4_3]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTRS_GEP4_3]] to i{{[0-9]+}}* + // CHECK: store i{{[0-9]+}} [[N]], i{{[0-9]+}}* [[BCAST_TOPTR]], // CHECK: [[SIZES_GEP4_3:%.+]] = getelementptr inbounds [5 x i{{[0-9]+}}], [5 x i{{[0-9]+}}]* [[SIZET4]], i{{[0-9]+}} 0, i{{[0-9]+}} 3 // CHECK-64: store i{{[0-9]+}} 8, i{{[0-9]+}}* [[SIZES_GEP4_3]], // CHECK-32: store i{{[0-9]+}} 4, i{{[0-9]+}}* [[SIZES_GEP4_3]], - // CHECK: [[B_BCAST:%.+]] = bitcast i{{[0-9]+}}* [[B:%.+]] to i8* // CHECK: [[BASE_PTRS_GEP4_4:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[BASE_PTRS4]], i{{[0-9]+}} 0, i{{[0-9]+}} 4 - // CHECK: store i8* [[B_BCAST]], i8** [[BASE_PTRS_GEP4_4]], - // CHECK: [[B_BCAST2:%.+]] = bitcast i{{[0-9]+}}* [[B:%.+]] to i8* + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTRS_GEP4_4]] to i{{[0-9]+}}** + // CHECK: store i{{[0-9]+}}* [[B:%.+]], i{{[0-9]+}}** [[BCAST_TOPTR]], // CHECK: [[PTRS_GEP4_4:%.+]] = getelementptr inbounds [5 x i8*], [5 x i8*]* [[PTRS4]], i{{[0-9]+}} 0, i{{[0-9]+}} 4 - // CHECK: store i8* [[B_BCAST2]], i8** [[PTRS_GEP4_4]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTRS_GEP4_4]] to i{{[0-9]+}}** + // CHECK: store i{{[0-9]+}}* [[B]], i{{[0-9]+}}** [[BCAST_TOPTR]], // CHECK: [[SIZES_GEP4_4:%.+]] = getelementptr inbounds [5 x i{{[0-9]+}}], [5 x i{{[0-9]+}}]* [[SIZET4]], i{{[0-9]+}} 0, i{{[0-9]+}} 4 // CHECK: store i{{[0-9]+}} [[B_SIZE:%.+]], i{{[0-9]+}}* [[SIZES_GEP4_4]], @@ -492,28 +496,28 @@ struct S1 { // CHECK: [[PTRS5:%.+]] = alloca [3 x i8*], // firstprivate(a): by value - // CHECK: [[A_CAST_PTR:%.+]] = inttoptr i{{[0-9]+}} [[A_CAST:%.+]] to i8* // CHECK: [[BASE_PTRS_GEP5_0:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BASE_PTRS5]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 - // CHECK: store i8* [[A_CAST_PTR]], i8** [[BASE_PTRS_GEP5_0]], - // CHECK: [[A_CAST_PTR2:%.+]] = inttoptr i{{[0-9]+}} [[A_CAST:%.+]] to i8* + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTRS_GEP5_0]] to i{{[0-9]+}}* + // CHECK: store i{{[0-9]+}} [[A_CAST:%.+]], i{{[0-9]+}}* [[BCAST_TOPTR]], // CHECK: [[PTRS_GEP5_0:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[PTRS5]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 - // CHECK: store i8* [[A_CAST_PTR2]], i8** [[PTRS_GEP5_0]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTRS_GEP5_0]] to i{{[0-9]+}}* + // CHECK: store i{{[0-9]+}} [[A_CAST]], i{{[0-9]+}}* [[BCAST_TOPTR]], // firstprivate(aaa): by value - // CHECK: [[A3_CAST_PTR:%.+]] = inttoptr i{{[0-9]+}} [[A3_CAST:%.+]] to i8* // CHECK: [[BASE_PTRS_GEP5_1:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BASE_PTRS5]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 - // CHECK: store i8* [[A3_CAST_PTR]], i8** [[BASE_PTRS_GEP5_1]], - // CHECK: [[A3_CAST_PTR2:%.+]] = inttoptr i{{[0-9]+}} [[A3_CAST:%.+]] to i8* + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTRS_GEP5_1]] to i{{[0-9]+}}* + // CHECK: store i{{[0-9]+}} [[A3_CAST:%.+]], i{{[0-9]+}}* [[BCAST_TOPTR]], // CHECK: [[PTRS_GEP5_1:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[PTRS5]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 - // CHECK: store i8* [[A3_CAST_PTR2]], i8** [[PTRS_GEP5_1]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTRS_GEP5_1]] to i{{[0-9]+}}* + // CHECK: store i{{[0-9]+}} [[A3_CAST]], i{{[0-9]+}}* [[BCAST_TOPTR]], // firstprivate(b): base_ptr = &b[0], ptr= &b[0] - // CHECK: [[B_BCAST:%.+]] = bitcast [10 x i{{[0-9]+}}]* [[B:%.+]] to i8* // CHECK: [[BASE_PTRS_GEP5_2:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BASE_PTRS5]], i{{[0-9]+}} 0, i{{[0-9]+}} 2 - // CHECK: store i8* [[B_BCAST]], i8** [[BASE_PTRS_GEP5_2]], - // CHECK: [[B_BCAST2:%.+]] = bitcast [10 x i{{[0-9]+}}]* [[B:%.+]] to i8* + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTRS_GEP5_2]] to [10 x i{{[0-9]+}}]** + // CHECK: store [10 x i{{[0-9]+}}]* [[B:%.+]], [10 x i{{[0-9]+}}]** [[BCAST_TOPTR]], // CHECK: [[PTRS_GEP5_2:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[PTRS5]], i{{[0-9]+}} 0, i{{[0-9]+}} 2 - // CHECK: store i8* [[B_BCAST2]], i8** [[PTRS_GEP5_2]], + // CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTRS_GEP5_2]] to [10 x i{{[0-9]+}}]** + // CHECK: store [10 x i{{[0-9]+}}]* [[B]], [10 x i{{[0-9]+}}]** [[BCAST_TOPTR]], // only check that the right sizes and map types are used // CHECK: call i32 @__tgt_target(i32 -1, {{.+}}, i32 3, i8** {{.+}}, i8** {{.+}}, i[[SZ]]* getelementptr inbounds ([3 x i[[SZ]]], [3 x i[[SZ]]]* [[SIZET5]], i32 0, i32 0), i32* getelementptr inbounds ([3 x i32], [3 x i32]* [[MAPT5]], i32 0, i32 0)) @@ -539,20 +543,20 @@ int bar(int n, double *ptr){ // CHECK: [[PTRS6:%.+]] = alloca [2 x i8*], // firstprivate(a): by value -// CHECK: [[AT_CAST_PTR:%.+]] = inttoptr i{{[0-9]+}} [[AT_CAST:%.+]] to i8* // CHECK: [[BASE_PTRS_GEP6_0:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BASE_PTRS6]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 -// CHECK: store i8* [[AT_CAST_PTR]], i8** [[BASE_PTRS_GEP6_0]], -// CHECK: [[AT_CAST_PTR2:%.+]] = inttoptr i{{[0-9]+}} [[AT_CAST:%.+]] to i8* +// CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTRS_GEP6_0]] to i{{[0-9]+}}* +// CHECK: store i{{[0-9]+}} [[AT_CAST:%.+]], i{{[0-9]+}}* [[BCAST_TOPTR]], // CHECK: [[PTRS_GEP6_0:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[PTRS6]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 -// CHECK: store i8* [[AT_CAST_PTR2]], i8** [[PTRS_GEP6_0]], +// CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTRS_GEP6_0]] to i{{[0-9]+}}* +// CHECK: store i{{[0-9]+}} [[AT_CAST]], i{{[0-9]+}}* [[BCAST_TOPTR]], // firstprivate(b): pointer -// CHECK: [[B_BCAST:%.+]] = bitcast [10 x i{{[0-9]+}}]* [[B:%.+]] to i8* // CHECK: [[BASE_PTRS_GEP6_1:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BASE_PTRS6]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 -// CHECK: store i8* [[B_BCAST]], i8** [[BASE_PTRS_GEP6_1]], -// CHECK: [[B_BCAST2:%.+]] = bitcast [10 x i{{[0-9]+}}]* [[B:%.+]] to i8* +// CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[BASE_PTRS_GEP6_1]] to [10 x i{{[0-9]+}}]** +// CHECK: store [10 x i{{[0-9]+}}]* [[B:%.+]], [10 x i{{[0-9]+}}]** [[BCAST_TOPTR]], // CHECK: [[PTRS_GEP6_1:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[PTRS6]], i{{[0-9]+}} 0, i{{[0-9]+}} 1 -// CHECK: store i8* [[B_BCAST2]], i8** [[PTRS_GEP6_1]], +// CHECK: [[BCAST_TOPTR:%.+]] = bitcast i8** [[PTRS_GEP6_1]] to [10 x i{{[0-9]+}}]** +// CHECK: store [10 x i{{[0-9]+}}]* [[B]], [10 x i{{[0-9]+}}]** [[BCAST_TOPTR]], // CHECK: call i32 @__tgt_target(i32 -1, {{.+}}, i32 2, i8** {{.+}}, i8** {{.+}}, i[[SZ]]* getelementptr inbounds ([2 x i[[SZ]]], [2 x i[[SZ]]]* [[SIZET6]], i32 0, i32 0), i32* getelementptr inbounds ([2 x i32], [2 x i32]* [[MAPT6]], i32 0, i32 0)) diff --git a/test/OpenMP/target_is_device_ptr_codegen.cpp b/test/OpenMP/target_is_device_ptr_codegen.cpp index 6c807294835a..1a54aa18c00b 100644 --- a/test/OpenMP/target_is_device_ptr_codegen.cpp +++ b/test/OpenMP/target_is_device_ptr_codegen.cpp @@ -46,10 +46,10 @@ void foo(float *&lr, T *&tr) { // CK1-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK1-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK1-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK1-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK1-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK1-DAG: [[VALBP]] = bitcast double* [[VAL:%.+]] to i8* - // CK1-DAG: [[VALP]] = bitcast double* [[VAL]] to i8* + // CK1-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double** + // CK1-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double** + // CK1-DAG: store double* [[VAL:%.+]], double** [[CBP1]] + // CK1-DAG: store double* [[VAL]], double** [[CP1]] // CK1-DAG: [[VAL]] = load double*, double** [[ADDR:@g]], // CK1: call void [[KERNEL:@.+]](double* [[VAL]]) @@ -63,10 +63,10 @@ void foo(float *&lr, T *&tr) { // CK1-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK1-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK1-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK1-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK1-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK1-DAG: [[VALBP]] = bitcast float* [[VAL:%.+]] to i8* - // CK1-DAG: [[VALP]] = bitcast float* [[VAL]] to i8* + // CK1-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to float** + // CK1-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to float** + // CK1-DAG: store float* [[VAL:%.+]], float** [[CBP1]] + // CK1-DAG: store float* [[VAL]], float** [[CP1]] // CK1-DAG: [[VAL]] = load float*, float** [[ADDR:%.+]], // CK1: call void [[KERNEL:@.+]](float* [[VAL]]) @@ -80,10 +80,10 @@ void foo(float *&lr, T *&tr) { // CK1-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK1-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK1-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK1-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK1-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK1-DAG: [[VALBP]] = bitcast i32* [[VAL:%.+]] to i8* - // CK1-DAG: [[VALP]] = bitcast i32* [[VAL]] to i8* + // CK1-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32** + // CK1-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** + // CK1-DAG: store i32* [[VAL:%.+]], i32** [[CBP1]] + // CK1-DAG: store i32* [[VAL]], i32** [[CP1]] // CK1-DAG: [[VAL]] = load i32*, i32** [[ADDR:%.+]], // CK1: call void [[KERNEL:@.+]](i32* [[VAL]]) @@ -97,10 +97,10 @@ void foo(float *&lr, T *&tr) { // CK1-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK1-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK1-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK1-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK1-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK1-DAG: [[VALBP]] = bitcast float* [[VAL:%.+]] to i8* - // CK1-DAG: [[VALP]] = bitcast float* [[VAL]] to i8* + // CK1-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to float** + // CK1-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to float** + // CK1-DAG: store float* [[VAL:%.+]], float** [[CBP1]] + // CK1-DAG: store float* [[VAL]], float** [[CP1]] // CK1-DAG: [[VAL]] = load float*, float** [[ADDR:%.+]], // CK1-DAG: [[ADDR]] = load float**, float*** [[ADDR2:%.+]], @@ -115,10 +115,10 @@ void foo(float *&lr, T *&tr) { // CK1-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK1-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK1-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK1-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK1-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK1-DAG: [[VALBP]] = bitcast i32* [[VAL:%.+]] to i8* - // CK1-DAG: [[VALP]] = bitcast i32* [[VAL]] to i8* + // CK1-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32** + // CK1-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** + // CK1-DAG: store i32* [[VAL:%.+]], i32** [[CBP1]] + // CK1-DAG: store i32* [[VAL]], i32** [[CP1]] // CK1-DAG: [[VAL]] = load i32*, i32** [[ADDR:%.+]], // CK1-DAG: [[ADDR]] = load i32**, i32*** [[ADDR2:%.+]], @@ -133,10 +133,10 @@ void foo(float *&lr, T *&tr) { // CK1-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK1-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK1-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK1-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK1-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK1-DAG: [[VALBP]] = bitcast i32* [[VAL:%.+]] to i8* - // CK1-DAG: [[VALP]] = bitcast i32* [[VAL]] to i8* + // CK1-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32** + // CK1-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** + // CK1-DAG: store i32* [[VAL:%.+]], i32** [[CBP1]] + // CK1-DAG: store i32* [[VAL]], i32** [[CP1]] // CK1-DAG: [[VAL]] = load i32*, i32** [[ADDR:%.+]], // CK1-DAG: [[ADDR]] = load i32**, i32*** [[ADDR2:%.+]], @@ -151,19 +151,19 @@ void foo(float *&lr, T *&tr) { // CK1-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK1-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK1-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK1-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK1-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK1-DAG: [[VALBP]] = bitcast i32* [[VAL:%.+]] to i8* - // CK1-DAG: [[VALP]] = bitcast i32* [[VAL]] to i8* + // CK1-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32** + // CK1-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** + // CK1-DAG: store i32* [[VAL:%.+]], i32** [[CBP1]] + // CK1-DAG: store i32* [[VAL]], i32** [[CP1]] // CK1-DAG: [[VAL]] = load i32*, i32** [[ADDR:%.+]], // CK1-DAG: [[ADDR]] = load i32**, i32*** [[ADDR2:%.+]], // CK1-DAG: [[_BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 1 // CK1-DAG: [[_P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 1 - // CK1-DAG: store i8* [[_VALBP:%.+]], i8** [[_BP1]], - // CK1-DAG: store i8* [[_VALP:%.+]], i8** [[_P1]], - // CK1-DAG: [[_VALBP]] = bitcast float* [[_VAL:%.+]] to i8* - // CK1-DAG: [[_VALP]] = bitcast float* [[_VAL]] to i8* + // CK1-DAG: [[_CBP1:%.+]] = bitcast i8** [[_BP1]] to float** + // CK1-DAG: [[_CP1:%.+]] = bitcast i8** [[_P1]] to float** + // CK1-DAG: store float* [[_VAL:%.+]], float** [[_CBP1]] + // CK1-DAG: store float* [[_VAL]], float** [[_CP1]] // CK1-DAG: [[_VAL]] = load float*, float** [[_ADDR:%.+]], // CK1-DAG: [[_ADDR]] = load float**, float*** [[_ADDR2:%.+]], @@ -215,10 +215,10 @@ struct ST { // CK2-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK2-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK2-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK2-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK2-DAG: [[CBPVAL0]] = bitcast [[ST]]* [[VAR0:%.+]] to i8* - // CK2-DAG: [[CPVAL0]] = bitcast double** [[SEC0:%.+]] to i8* + // CK2-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK2-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to double*** + // CK2-DAG: store [[ST]]* [[VAR0:%.+]], [[ST]]** [[CBP0]] + // CK2-DAG: store double** [[SEC0:%.+]], double*** [[CP0]] // CK2-DAG: [[SEC0]] = getelementptr {{.*}}[[ST]]* [[VAR0]], i{{.+}} 0, i{{.+}} 0 #pragma omp target is_device_ptr(a) { @@ -231,18 +231,18 @@ struct ST { // CK2-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK2-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK2-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK2-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK2-DAG: [[CBPVAL0]] = bitcast [[ST]]* [[VAR0:%.+]] to i8* - // CK2-DAG: [[CPVAL0]] = bitcast double*** [[SEC0:%.+]] to i8* + // CK2-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK2-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to double**** + // CK2-DAG: store [[ST]]* [[VAR0:%.+]], [[ST]]** [[CBP0]] + // CK2-DAG: store double*** [[SEC0:%.+]], double**** [[CP0]] // CK2-DAG: [[SEC0]] = getelementptr {{.*}}[[ST]]* [[VAR0]], i{{.+}} 0, i{{.+}} 1 // CK2-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK2-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK2-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK2-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK2-DAG: [[CBPVAL1]] = bitcast double*** [[SEC0]] to i8* - // CK2-DAG: [[CPVAL1]] = bitcast double** [[SEC1:%.+]] to i8* + // CK2-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double**** + // CK2-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double*** + // CK2-DAG: store double*** [[SEC0]], double**** [[CBP1]] + // CK2-DAG: store double** [[SEC1:%.+]], double*** [[CP1]] // CK2-DAG: [[SEC1]] = load double**, double*** [[SEC0]] #pragma omp target is_device_ptr(b) { @@ -255,26 +255,26 @@ struct ST { // CK2-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK2-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK2-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK2-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK2-DAG: [[CBPVAL0]] = bitcast [[ST]]* [[VAR0:%.+]] to i8* - // CK2-DAG: [[CPVAL0]] = bitcast double*** [[SEC0:%.+]] to i8* + // CK2-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK2-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to double**** + // CK2-DAG: store [[ST]]* [[VAR0:%.+]], [[ST]]** [[CBP0]] + // CK2-DAG: store double*** [[SEC0:%.+]], double**** [[CP0]] // CK2-DAG: [[SEC0]] = getelementptr {{.*}}[[ST]]* [[VAR0]], i{{.+}} 0, i{{.+}} 1 // CK2-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 2 // CK2-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 2 - // CK2-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK2-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK2-DAG: [[CBPVAL1]] = bitcast double*** [[SEC0]] to i8* - // CK2-DAG: [[CPVAL1]] = bitcast double** [[SEC1:%.+]] to i8* + // CK2-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double**** + // CK2-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double*** + // CK2-DAG: store double*** [[SEC0]], double**** [[CBP1]] + // CK2-DAG: store double** [[SEC1:%.+]], double*** [[CP1]] // CK2-DAG: [[SEC1]] = load double**, double*** [[SEC0]] // CK2-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK2-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK2-DAG: store i8* [[CBPVAL2:%[^,]+]], i8** [[BP2]] - // CK2-DAG: store i8* [[CPVAL2:%[^,]+]], i8** [[P2]] - // CK2-DAG: [[CBPVAL2]] = bitcast [[ST]]* [[VAR2:%.+]] to i8* - // CK2-DAG: [[CPVAL2]] = bitcast double** [[SEC2:%.+]] to i8* + // CK2-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to [[ST]]** + // CK2-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to double*** + // CK2-DAG: store [[ST]]* [[VAR2:%.+]], [[ST]]** [[CBP2]] + // CK2-DAG: store double** [[SEC2:%.+]], double*** [[CP2]] // CK2-DAG: [[SEC2]] = getelementptr {{.*}}[[ST]]* [[VAR2]], i{{.+}} 0, i{{.+}} 0 #pragma omp target is_device_ptr(a, b) { diff --git a/test/OpenMP/target_map_codegen.cpp b/test/OpenMP/target_map_codegen.cpp index 72c7257a0ea7..69e80bb9505b 100644 --- a/test/OpenMP/target_map_codegen.cpp +++ b/test/OpenMP/target_map_codegen.cpp @@ -28,10 +28,10 @@ void implicit_maps_integer (int a){ // CK1-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK1-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK1-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK1-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK1-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK1-DAG: [[VALBP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* - // CK1-DAG: [[VALP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* + // CK1-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz]]* + // CK1-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]* + // CK1-DAG: store i[[sz]] [[VAL:%[^,]+]], i[[sz]]* [[CBP1]] + // CK1-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]] // CK1-DAG: [[VAL]] = load i[[sz]], i[[sz]]* [[ADDR:%.+]], // CK1-64-DAG: [[CADDR:%.+]] = bitcast i[[sz]]* [[ADDR]] to i32* // CK1-64-DAG: store i32 {{.+}}, i32* [[CADDR]], @@ -75,10 +75,10 @@ void implicit_maps_reference (int a, int *b){ // CK2-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK2-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK2-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK2-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK2-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK2-DAG: [[VALBP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* - // CK2-DAG: [[VALP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* + // CK2-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz]]* + // CK2-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]* + // CK2-DAG: store i[[sz]] [[VAL:%[^,]+]], i[[sz]]* [[CBP1]] + // CK2-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]] // CK2-DAG: [[VAL]] = load i[[sz]], i[[sz]]* [[ADDR:%.+]], // CK2-64-DAG: [[CADDR:%.+]] = bitcast i[[sz]]* [[ADDR]] to i32* // CK2-64-DAG: store i32 {{.+}}, i32* [[CADDR]], @@ -95,10 +95,10 @@ void implicit_maps_reference (int a, int *b){ // CK2-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK2-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK2-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK2-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK2-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK2-DAG: [[VALBP]] = bitcast i32* [[VAL:%.+]] to i8* - // CK2-DAG: [[VALP]] = bitcast i32* [[VAL]] to i8* + // CK2-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32** + // CK2-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** + // CK2-DAG: store i32* [[VAL:%[^,]+]], i32** [[CBP1]] + // CK2-DAG: store i32* [[VAL]], i32** [[CP1]] // CK2-DAG: [[VAL]] = load i32*, i32** [[ADDR:%.+]], // CK2-DAG: [[ADDR]] = load i32**, i32*** [[ADDR2:%.+]], @@ -151,10 +151,10 @@ void implicit_maps_parameter (int a){ // CK3-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK3-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK3-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK3-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK3-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK3-DAG: [[VALBP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* - // CK3-DAG: [[VALP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* + // CK3-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz]]* + // CK3-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]* + // CK3-DAG: store i[[sz]] [[VAL:%[^,]+]], i[[sz]]* [[CBP1]] + // CK3-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]] // CK3-DAG: [[VAL]] = load i[[sz]], i[[sz]]* [[ADDR:%.+]], // CK3-64-DAG: [[CADDR:%.+]] = bitcast i[[sz]]* [[ADDR]] to i32* // CK3-64-DAG: store i32 {{.+}}, i32* [[CADDR]], @@ -203,10 +203,10 @@ void implicit_maps_nested_integer (int a){ // CK4-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK4-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK4-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK4-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK4-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK4-DAG: [[VALBP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* - // CK4-DAG: [[VALP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* + // CK4-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz]]* + // CK4-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]* + // CK4-DAG: store i[[sz]] [[VAL:%[^,]+]], i[[sz]]* [[CBP1]] + // CK4-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]] // CK4-DAG: [[VAL]] = load i[[sz]], i[[sz]]* [[ADDR:%.+]], // CK4-64-DAG: [[CADDR:%.+]] = bitcast i[[sz]]* [[ADDR]] to i32* // CK4-64-DAG: store i32 {{.+}}, i32* [[CADDR]], @@ -257,10 +257,10 @@ void implicit_maps_nested_integer_and_enum (int a){ // CK5-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK5-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK5-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK5-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK5-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK5-DAG: [[VALBP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* - // CK5-DAG: [[VALP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* + // CK5-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz]]* + // CK5-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]* + // CK5-DAG: store i[[sz]] [[VAL:%[^,]+]], i[[sz]]* [[CBP1]] + // CK5-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]] // CK5-DAG: [[VAL]] = load i[[sz]], i[[sz]]* [[ADDR:%.+]], // CK5-64-DAG: [[CADDR:%.+]] = bitcast i[[sz]]* [[ADDR]] to i32* // CK5-64-DAG: store i32 {{.+}}, i32* [[CADDR]], @@ -302,10 +302,10 @@ void implicit_maps_host_global (int a){ // CK6-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK6-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK6-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK6-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK6-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK6-DAG: [[VALBP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* - // CK6-DAG: [[VALP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* + // CK6-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz]]* + // CK6-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]* + // CK6-DAG: store i[[sz]] [[VAL:%[^,]+]], i[[sz]]* [[CBP1]] + // CK6-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]] // CK6-64-DAG: [[VAL]] = load i[[sz]], i[[sz]]* [[ADDR:%.+]], // CK6-64-DAG: [[CADDR:%.+]] = bitcast i[[sz]]* [[ADDR]] to i32* // CK6-64-DAG: store i32 [[GBLVAL:%.+]], i32* [[CADDR]], @@ -355,18 +355,18 @@ void implicit_maps_double (int a){ // CK7-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK7-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK7-64-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK7-64-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK7-64-DAG: [[VALBP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* - // CK7-64-DAG: [[VALP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* + // CK7-64-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz]]* + // CK7-64-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]* + // CK7-64-DAG: store i[[sz]] [[VAL:%[^,]+]], i[[sz]]* [[CBP1]] + // CK7-64-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]] // CK7-64-DAG: [[VAL]] = load i[[sz]], i[[sz]]* [[ADDR:%.+]], // CK7-64-64-DAG: [[CADDR:%.+]] = bitcast i[[sz]]* [[ADDR]] to double* // CK7-64-64-DAG: store double {{.+}}, double* [[CADDR]], - // CK7-32-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK7-32-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK7-32-DAG: [[VALBP]] = bitcast double* [[DECL:%.+]] to i8* - // CK7-32-DAG: [[VALP]] = bitcast double* [[DECL]] to i8* + // CK7-32-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double** + // CK7-32-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double** + // CK7-32-DAG: store double* [[DECL:%[^,]+]], double** [[CBP1]] + // CK7-32-DAG: store double* [[DECL]], double** [[CP1]] // CK7-64: call void [[KERNEL:@.+]](i[[sz]] [[VAL]]) // CK7-32: call void [[KERNEL:@.+]](double* [[DECL]]) @@ -411,10 +411,10 @@ void implicit_maps_float (int a){ // CK8-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK8-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK8-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK8-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK8-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK8-DAG: [[VALBP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* - // CK8-DAG: [[VALP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* + // CK8-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz]]* + // CK8-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]* + // CK8-DAG: store i[[sz]] [[VAL:%[^,]+]], i[[sz]]* [[CBP1]] + // CK8-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]] // CK8-DAG: [[VAL]] = load i[[sz]], i[[sz]]* [[ADDR:%.+]], // CK8-DAG: [[CADDR:%.+]] = bitcast i[[sz]]* [[ADDR]] to float* // CK8-DAG: store float {{.+}}, float* [[CADDR]], @@ -455,10 +455,10 @@ void implicit_maps_array (int a){ // CK9-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK9-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK9-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK9-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK9-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK9-DAG: [[VALBP]] = bitcast [2 x double]* [[DECL:%.+]] to i8* - // CK9-DAG: [[VALP]] = bitcast [2 x double]* [[DECL]] to i8* + // CK9-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [2 x double]** + // CK9-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to [2 x double]** + // CK9-DAG: store [2 x double]* [[DECL:%[^,]+]], [2 x double]** [[CBP1]] + // CK9-DAG: store [2 x double]* [[DECL]], [2 x double]** [[CP1]] // CK9: call void [[KERNEL:@.+]]([2 x double]* [[DECL]]) #pragma omp target @@ -496,10 +496,10 @@ void implicit_maps_pointer (){ // CK10-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK10-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK10-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK10-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK10-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK10-DAG: [[VALBP]] = bitcast double* [[PTR:%.+]] to i8* - // CK10-DAG: [[VALP]] = bitcast double* [[PTR]] to i8* + // CK10-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double** + // CK10-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double** + // CK10-DAG: store double* [[PTR:%[^,]+]], double** [[CBP1]] + // CK10-DAG: store double* [[PTR]], double** [[CP1]] // CK10: call void [[KERNEL:@.+]](double* [[PTR]]) #pragma omp target @@ -538,10 +538,10 @@ void implicit_maps_double_complex (int a){ // CK11-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK11-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK11-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK11-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK11-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK11-DAG: [[VALBP]] = bitcast { double, double }* [[PTR:%.+]] to i8* - // CK11-DAG: [[VALP]] = bitcast { double, double }* [[PTR]] to i8* + // CK11-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to { double, double }** + // CK11-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to { double, double }** + // CK11-DAG: store { double, double }* [[PTR:%[^,]+]], { double, double }** [[CBP1]] + // CK11-DAG: store { double, double }* [[PTR]], { double, double }** [[CP1]] // CK11: call void [[KERNEL:@.+]]({ double, double }* [[PTR]]) #pragma omp target @@ -584,18 +584,18 @@ void implicit_maps_float_complex (int a){ // CK12-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK12-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK12-64-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK12-64-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK12-64-DAG: [[VALBP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* - // CK12-64-DAG: [[VALP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* + // CK12-64-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz]]* + // CK12-64-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]* + // CK12-64-DAG: store i[[sz]] [[VAL:%[^,]+]], i[[sz]]* [[CBP1]] + // CK12-64-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]] // CK12-64-DAG: [[VAL]] = load i[[sz]], i[[sz]]* [[ADDR:%.+]], // CK12-64-DAG: [[CADDR:%.+]] = bitcast i[[sz]]* [[ADDR]] to { float, float }* // CK12-64-DAG: store { float, float } {{.+}}, { float, float }* [[CADDR]], - // CK12-32-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK12-32-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK12-32-DAG: [[VALBP]] = bitcast { float, float }* [[DECL:%.+]] to i8* - // CK12-32-DAG: [[VALP]] = bitcast { float, float }* [[DECL]] to i8* + // CK12-32-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to { float, float }** + // CK12-32-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to { float, float }** + // CK12-32-DAG: store { float, float }* [[DECL:%[^,]+]], { float, float }** [[CBP1]] + // CK12-32-DAG: store { float, float }* [[DECL]], { float, float }** [[CP1]] // CK12-64: call void [[KERNEL:@.+]](i[[sz]] [[VAL]]) // CK12-32: call void [[KERNEL:@.+]]({ float, float }* [[DECL]]) @@ -645,27 +645,29 @@ void implicit_maps_variable_length_array (int a){ // CK13-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK13-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 // CK13-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[SS]], i32 0, i32 0 - // CK13-DAG: store i8* inttoptr (i[[sz]] 2 to i8*), i8** [[BP0]], - // CK13-DAG: store i8* inttoptr (i[[sz]] 2 to i8*), i8** [[P0]], + // CK13-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i[[sz]]* + // CK13-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i[[sz]]* + // CK13-DAG: store i[[sz]] 2, i[[sz]]* [[CBP0]] + // CK13-DAG: store i[[sz]] 2, i[[sz]]* [[CP0]] // CK13-DAG: store i[[sz]] {{8|4}}, i[[sz]]* [[S0]], // CK13-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 1 // CK13-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 1 // CK13-DAG: [[S1:%.+]] = getelementptr inbounds {{.+}}[[SS]], i32 0, i32 1 - // CK13-DAG: store i8* [[VALBP1:%.+]], i8** [[BP1]], - // CK13-DAG: store i8* [[VALP1:%.+]], i8** [[P1]], - // CK13-DAG: [[VALBP1]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* - // CK13-DAG: [[VALP1]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* + // CK13-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz]]* + // CK13-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]* + // CK13-DAG: store i[[sz]] [[VAL:%.+]], i[[sz]]* [[CBP1]] + // CK13-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]] // CK13-DAG: store i[[sz]] {{8|4}}, i[[sz]]* [[S1]], // CK13-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 2 // CK13-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 2 // CK13-DAG: [[S2:%.+]] = getelementptr inbounds {{.+}}[[SS]], i32 0, i32 2 - // CK13-DAG: store i8* [[VALBP2:%.+]], i8** [[BP2]], - // CK13-DAG: store i8* [[VALP2:%.+]], i8** [[P2]], + // CK13-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to double** + // CK13-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to double** + // CK13-DAG: store double* [[DECL:%.+]], double** [[CBP2]] + // CK13-DAG: store double* [[DECL]], double** [[CP2]] // CK13-DAG: store i[[sz]] [[VALS2:%.+]], i[[sz]]* [[S2]], - // CK13-DAG: [[VALBP2]] = bitcast double* [[DECL:%.+]] to i8* - // CK13-DAG: [[VALP2]] = bitcast double* [[DECL]] to i8* // CK13-DAG: [[VALS2]] = mul nuw i[[sz]] %{{.+}}, 8 // CK13: call void [[KERNEL:@.+]](i[[sz]] {{.+}}, i[[sz]] {{.+}}, double* [[DECL]]) @@ -730,17 +732,17 @@ void implicit_maps_class (int a){ // CK14-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK14-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK14-DAG: store i8* [[VALBP0:%.+]], i8** [[BP0]], - // CK14-DAG: store i8* [[VALP0:%.+]], i8** [[P0]], - // CK14-DAG: [[VALBP0]] = bitcast [[ST]]* [[DECL:%.+]] to i8* - // CK14-DAG: [[VALP0]] = bitcast [[ST]]* [[DECL]] to i8* + // CK14-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK14-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[ST]]** + // CK14-DAG: store [[ST]]* [[DECL:%.+]], [[ST]]** [[CBP0]] + // CK14-DAG: store [[ST]]* [[DECL]], [[ST]]** [[CP0]] // CK14-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 1 // CK14-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 1 - // CK14-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK14-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK14-DAG: [[VALBP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* - // CK14-DAG: [[VALP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* + // CK14-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz]]* + // CK14-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]* + // CK14-DAG: store i[[sz]] [[VAL:%.+]], i[[sz]]* [[CBP1]] + // CK14-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]] // CK14-DAG: [[VAL]] = load i[[sz]], i[[sz]]* [[ADDR:%.+]], // CK14-64-DAG: [[CADDR:%.+]] = bitcast i[[sz]]* [[ADDR]] to i32* // CK14-64-DAG: store i32 {{.+}}, i32* [[CADDR]], @@ -822,17 +824,17 @@ void implicit_maps_templated_class (int a){ // CK15-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK15-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK15-DAG: store i8* [[VALBP0:%.+]], i8** [[BP0]], - // CK15-DAG: store i8* [[VALP0:%.+]], i8** [[P0]], - // CK15-DAG: [[VALBP0]] = bitcast [[ST]]* [[DECL:%.+]] to i8* - // CK15-DAG: [[VALP0]] = bitcast [[ST]]* [[DECL]] to i8* + // CK15-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK15-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[ST]]** + // CK15-DAG: store [[ST]]* [[DECL:%.+]], [[ST]]** [[CBP0]] + // CK15-DAG: store [[ST]]* [[DECL]], [[ST]]** [[CP0]] // CK15-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 1 // CK15-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 1 - // CK15-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK15-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK15-DAG: [[VALBP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* - // CK15-DAG: [[VALP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* + // CK15-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz]]* + // CK15-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]* + // CK15-DAG: store i[[sz]] [[VAL:%.+]], i[[sz]]* [[CBP1]] + // CK15-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]] // CK15-DAG: [[VAL]] = load i[[sz]], i[[sz]]* [[ADDR:%.+]], // CK15-64-DAG: [[CADDR:%.+]] = bitcast i[[sz]]* [[ADDR]] to i32* // CK15-64-DAG: store i32 {{.+}}, i32* [[CADDR]], @@ -847,17 +849,17 @@ void implicit_maps_templated_class (int a){ // CK15-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK15-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK15-DAG: store i8* [[VALBP0:%.+]], i8** [[BP0]], - // CK15-DAG: store i8* [[VALP0:%.+]], i8** [[P0]], - // CK15-DAG: [[VALBP0]] = bitcast [[ST]]* [[DECL:%.+]] to i8* - // CK15-DAG: [[VALP0]] = bitcast [[ST]]* [[DECL]] to i8* + // CK15-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK15-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[ST]]** + // CK15-DAG: store [[ST]]* [[DECL:%.+]], [[ST]]** [[CBP0]] + // CK15-DAG: store [[ST]]* [[DECL]], [[ST]]** [[CP0]] // CK15-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 1 // CK15-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 1 - // CK15-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK15-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK15-DAG: [[VALBP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* - // CK15-DAG: [[VALP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* + // CK15-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz]]* + // CK15-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]* + // CK15-DAG: store i[[sz]] [[VAL:%.+]], i[[sz]]* [[CBP1]] + // CK15-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]] // CK15-DAG: [[VAL]] = load i[[sz]], i[[sz]]* [[ADDR:%.+]], // CK15-64-DAG: [[CADDR:%.+]] = bitcast i[[sz]]* [[ADDR]] to i32* // CK15-64-DAG: store i32 {{.+}}, i32* [[CADDR]], @@ -923,10 +925,10 @@ void implicit_maps_templated_function (int a){ // CK16-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK16-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK16-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK16-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK16-DAG: [[VALBP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* - // CK16-DAG: [[VALP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* + // CK16-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz]]* + // CK16-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]* + // CK16-DAG: store i[[sz]] [[VAL:%.+]], i[[sz]]* [[CBP1]] + // CK16-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]] // CK16-DAG: [[VAL]] = load i[[sz]], i[[sz]]* [[ADDR:%.+]], // CK16-64-DAG: [[CADDR:%.+]] = bitcast i[[sz]]* [[ADDR]] to i32* // CK16-64-DAG: store i32 {{.+}}, i32* [[CADDR]], @@ -971,10 +973,10 @@ void implicit_maps_struct (int a){ // CK17-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK17-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK17-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK17-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK17-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK17-DAG: [[VALBP]] = bitcast [[ST]]* [[DECL:%.+]] to i8* - // CK17-DAG: [[VALP]] = bitcast [[ST]]* [[DECL]] to i8* + // CK17-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[ST]]** + // CK17-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to [[ST]]** + // CK17-DAG: store [[ST]]* [[DECL:%.+]], [[ST]]** [[CBP1]] + // CK17-DAG: store [[ST]]* [[DECL]], [[ST]]** [[CP1]] // CK17: call void [[KERNEL:@.+]]([[ST]]* [[DECL]]) #pragma omp target @@ -1023,10 +1025,10 @@ void implicit_maps_template_type_capture (int a){ // CK18-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK18-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK18-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK18-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK18-DAG: [[VALBP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* - // CK18-DAG: [[VALP]] = inttoptr i[[sz]] [[VAL:%.+]] to i8* + // CK18-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[sz]]* + // CK18-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[sz]]* + // CK18-DAG: store i[[sz]] [[VAL:%.+]], i[[sz]]* [[CBP1]] + // CK18-DAG: store i[[sz]] [[VAL]], i[[sz]]* [[CP1]] // CK18-DAG: [[VAL]] = load i[[sz]], i[[sz]]* [[ADDR:%.+]], // CK18-64-DAG: [[CADDR:%.+]] = bitcast i[[sz]]* [[ADDR]] to i32* // CK18-64-DAG: store i32 {{.+}}, i32* [[CADDR]], @@ -1054,6 +1056,9 @@ void implicit_maps_template_type_capture (int a){ // CK19: [[SIZE00:@.+]] = private {{.*}}constant [1 x i[[Z:64|32]]] [i[[Z:64|32]] 4] // CK19: [[MTYPE00:@.+]] = private {{.*}}constant [1 x i32] [i32 32] +// CK19: [[SIZE00n:@.+]] = private {{.*}}constant [1 x i[[Z:64|32]]] [i[[Z:64|32]] 4] +// CK19: [[MTYPE00n:@.+]] = private {{.*}}constant [1 x i32] [i32 32] + // CK19: [[SIZE01:@.+]] = private {{.*}}constant [1 x i[[Z]]] [i[[Z]] 400] // CK19: [[MTYPE01:@.+]] = private {{.*}}constant [1 x i32] [i32 33] @@ -1181,10 +1186,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast i32* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[VAR0]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store i32* [[VAR0:%.+]], i32** [[CBP0]] + // CK19-DAG: store i32* [[VAR0]], i32** [[CP0]] // CK19: call void [[CALL00:@.+]](i32* {{[^,]+}}) #pragma omp target map(alloc:a) @@ -1192,6 +1197,28 @@ void explicit_maps_single (int ii){ ++a; } + // Map of a scalar in nested region. + int b = a; + + // Region 00n + // CK19-DAG: call i32 @__tgt_target(i32 {{[^,]+}}, i8* {{[^,]+}}, i32 1, i8** [[GEPBP:%.+]], i8** [[GEPP:%.+]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[SIZE00n]], {{.+}}getelementptr {{.+}}[1 x i{{.+}}]* [[MTYPE00n]]{{.+}}) + // CK19-DAG: [[GEPBP]] = getelementptr inbounds {{.+}}[[BP:%[^,]+]] + // CK19-DAG: [[GEPP]] = getelementptr inbounds {{.+}}[[P:%[^,]+]] + + // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 + // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store i32* [[VAR0:%.+]], i32** [[CBP0]] + // CK19-DAG: store i32* [[VAR0]], i32** [[CP0]] + + // CK19: call void [[CALL00n:@.+]](i32* {{[^,]+}}) + #pragma omp target map(alloc:b) + #pragma omp parallel + { + ++b; + } + // Map of an array. int arra[100]; @@ -1202,10 +1229,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [100 x i32]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast [100 x i32]* [[VAR0]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x i32]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [100 x i32]** + // CK19-DAG: store [100 x i32]* [[VAR0:%.+]], [100 x i32]** [[CBP0]] + // CK19-DAG: store [100 x i32]* [[VAR0]], [100 x i32]** [[CP0]] // CK19: call void [[CALL01:@.+]]([100 x i32]* {{[^,]+}}) #pragma omp target map(to:arra) @@ -1220,10 +1247,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [100 x i32]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x i32]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store [100 x i32]* [[VAR0:%.+]], [100 x i32]** [[CBP0]] + // CK19-DAG: store i32* [[SEC0:%[^,]+]], i32** [[CP0]] // CK19-DAG: [[SEC0]] = getelementptr {{.*}}[100 x i32]* [[VAR0]], i{{.+}} 0, i{{.+}} 20 // CK19: call void [[CALL02:@.+]]([100 x i32]* {{[^,]+}}) @@ -1239,10 +1266,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [100 x i32]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x i32]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store [100 x i32]* [[VAR0:%.+]], [100 x i32]** [[CBP0]] + // CK19-DAG: store i32* [[SEC0:%[^,]+]], i32** [[CP0]] // CK19-DAG: [[SEC0]] = getelementptr {{.*}}[100 x i32]* [[VAR0]], i{{.+}} 0, i{{.+}} 0 // CK19: call void [[CALL03:@.+]]([100 x i32]* {{[^,]+}}) @@ -1258,10 +1285,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [100 x i32]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x i32]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store [100 x i32]* [[VAR0:%.+]], [100 x i32]** [[CBP0]] + // CK19-DAG: store i32* [[SEC0:%[^,]+]], i32** [[CP0]] // CK19-DAG: [[SEC0]] = getelementptr {{.*}}[100 x i32]* [[VAR0]], i{{.+}} 0, i{{.+}} 0 // CK19: call void [[CALL04:@.+]]([100 x i32]* {{[^,]+}}) @@ -1277,10 +1304,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [100 x i32]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x i32]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store [100 x i32]* [[VAR0:%.+]], [100 x i32]** [[CBP0]] + // CK19-DAG: store i32* [[SEC0:%[^,]+]], i32** [[CP0]] // CK19-DAG: [[SEC0]] = getelementptr {{.*}}[100 x i32]* [[VAR0]], i{{.+}} 0, i{{.+}} 15 // CK19: call void [[CALL05:@.+]]([100 x i32]* {{[^,]+}}) @@ -1298,11 +1325,11 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x i32]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store [100 x i32]* [[VAR0:%.+]], [100 x i32]** [[CBP0]] + // CK19-DAG: store i32* [[SEC0:%[^,]+]], i32** [[CP0]] // CK19-DAG: store i{{.+}} [[CSVAL0:%[^,]+]], i{{.+}}* [[S0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [100 x i32]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* // CK19-DAG: [[CSVAL0]] = mul nuw i{{.+}} %{{.*}}, 4 // CK19-DAG: [[SEC0]] = getelementptr {{.*}}[100 x i32]* [[VAR0]], i{{.+}} 0, i{{.+}} %{{.*}} @@ -1321,11 +1348,11 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x i32]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store [100 x i32]* [[VAR0:%.+]], [100 x i32]** [[CBP0]] + // CK19-DAG: store i32* [[SEC0:%[^,]+]], i32** [[CP0]] // CK19-DAG: store i{{.+}} [[CSVAL0:%[^,]+]], i{{.+}}* [[S0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [100 x i32]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* // CK19-DAG: [[CSVAL0]] = mul nuw i{{.+}} %{{.*}}, 4 // CK19-DAG: [[SEC0]] = getelementptr {{.*}}[100 x i32]* [[VAR0]], i{{.+}} 0, i{{.+}} 0 @@ -1342,10 +1369,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [100 x i32]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x i32]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store [100 x i32]* [[VAR0:%.+]], [100 x i32]** [[CBP0]] + // CK19-DAG: store i32* [[SEC0:%[^,]+]], i32** [[CP0]] // CK19-DAG: [[SEC0]] = getelementptr {{.*}}[100 x i32]* [[VAR0]], i{{.+}} 0, i{{.+}} %{{.*}} // CK19: call void [[CALL08:@.+]]([100 x i32]* {{[^,]+}}) @@ -1364,10 +1391,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast i32** [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32** [[VAR0]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32*** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32*** + // CK19-DAG: store i32** [[VAR0:%.+]], i32*** [[CBP0]] + // CK19-DAG: store i32** [[VAR0]], i32*** [[CP0]] // CK19: call void [[CALL09:@.+]](i32** {{[^,]+}}) #pragma omp target map(from:pa) @@ -1382,10 +1409,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast i32* [[RVAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store i32* [[RVAR0:%.+]], i32** [[CBP0]] + // CK19-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK19-DAG: [[RVAR0]] = load i32*, i32** [[VAR0:%[^,]+]] // CK19-DAG: [[SEC0]] = getelementptr {{.*}}i32* [[RVAR00:%.+]], i{{.+}} 20 // CK19-DAG: [[RVAR00]] = load i32*, i32** [[VAR0]] @@ -1403,10 +1430,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast i32* [[RVAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store i32* [[RVAR0:%.+]], i32** [[CBP0]] + // CK19-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK19-DAG: [[RVAR0]] = load i32*, i32** [[VAR0:%[^,]+]] // CK19-DAG: [[SEC0]] = getelementptr {{.*}}i32* [[RVAR00:%.+]], i{{.+}} 0 // CK19-DAG: [[RVAR00]] = load i32*, i32** [[VAR0]] @@ -1424,10 +1451,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast i32* [[RVAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store i32* [[RVAR0:%.+]], i32** [[CBP0]] + // CK19-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK19-DAG: [[RVAR0]] = load i32*, i32** [[VAR0:%[^,]+]] // CK19-DAG: [[SEC0]] = getelementptr {{.*}}i32* [[RVAR00:%.+]], i{{.+}} 15 // CK19-DAG: [[RVAR00]] = load i32*, i32** [[VAR0]] @@ -1447,11 +1474,11 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store i32* [[RVAR0:%.+]], i32** [[CBP0]] + // CK19-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK19-DAG: store i{{.+}} [[CSVAL0:%[^,]+]], i{{.+}}* [[S0]] - // CK19-DAG: [[CBPVAL0]] = bitcast i32* [[RVAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* // CK19-DAG: [[CSVAL0]] = mul nuw i{{.+}} %{{.*}}, 4 // CK19-DAG: [[RVAR0]] = load i32*, i32** [[VAR0:%[^,]+]] // CK19-DAG: [[SEC0]] = getelementptr {{.*}}i32* [[RVAR00:%.+]], i{{.+}} %{{.*}} @@ -1472,11 +1499,11 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store i32* [[RVAR0:%.+]], i32** [[CBP0]] + // CK19-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK19-DAG: store i{{.+}} [[CSVAL0:%[^,]+]], i{{.+}}* [[S0]] - // CK19-DAG: [[CBPVAL0]] = bitcast i32* [[RVAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* // CK19-DAG: [[CSVAL0]] = mul nuw i{{.+}} %{{.*}}, 4 // CK19-DAG: [[RVAR0]] = load i32*, i32** [[VAR0:%[^,]+]] // CK19-DAG: [[SEC0]] = getelementptr {{.*}}i32* [[RVAR00:%.+]], i{{.+}} 0 @@ -1495,10 +1522,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast i32* [[RVAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store i32* [[RVAR0:%.+]], i32** [[CBP0]] + // CK19-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK19-DAG: [[RVAR0]] = load i32*, i32** [[VAR0:%[^,]+]] // CK19-DAG: [[SEC0]] = getelementptr {{.*}}i32* [[RVAR00:%.+]], i{{.+}} %{{.*}} // CK19-DAG: [[RVAR00]] = load i32*, i32** [[VAR0]] @@ -1521,20 +1548,20 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i[[Z]]* + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i[[Z]]* + // CK19-DAG: store i[[Z]] {{%.+}}, i[[Z]]* [[CBP0]] + // CK19-DAG: store i[[Z]] {{%.+}}, i[[Z]]* [[CP0]] // CK19-DAG: store i{{.+}} {{8|4}}, i{{.+}}* [[S0]] - // CK19-DAG: [[CBPVAL0]] = inttoptr i[[Z]] %{{.+}} to i8* - // CK19-DAG: [[CPVAL0]] = inttoptr i[[Z]] %{{.+}}to i8* // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[S1:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 1 - // CK19-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK19-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] + // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32** + // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** + // CK19-DAG: store i32* [[VAR1:%.+]], i32** [[CBP1]] + // CK19-DAG: store i32* [[VAR1]], i32** [[CP1]] // CK19-DAG: store i{{.+}} [[CSVAL1:%[^,]+]], i{{.+}}* [[S1]] - // CK19-DAG: [[CBPVAL1]] = bitcast i32* [[VAR1:%.+]] to i8* - // CK19-DAG: [[CPVAL1]] = bitcast i32* [[VAR1]] to i8* // CK19-DAG: [[CSVAL1]] = mul nuw i{{.+}} %{{.*}}, 4 // CK19: call void [[CALL16:@.+]](i{{.+}} {{[^,]+}}, i32* {{[^,]+}}) @@ -1550,17 +1577,17 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = inttoptr i[[Z]] %{{.+}} to i8* - // CK19-DAG: [[CPVAL0]] = inttoptr i[[Z]] %{{.+}}to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i[[Z]]* + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i[[Z]]* + // CK19-DAG: store i[[Z]] {{%.+}}, i[[Z]]* [[CBP0]] + // CK19-DAG: store i[[Z]] {{%.+}}, i[[Z]]* [[CP0]] // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK19-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK19-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK19-DAG: [[CBPVAL1]] = bitcast i32* [[VAR1:%.+]] to i8* - // CK19-DAG: [[CPVAL1]] = bitcast i32* [[SEC1:%.+]] to i8* + // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32** + // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** + // CK19-DAG: store i32* [[VAR1:%.+]], i32** [[CBP1]] + // CK19-DAG: store i32* [[SEC1:%.+]], i32** [[CP1]] // CK19-DAG: [[SEC1]] = getelementptr {{.*}}i32* [[VAR1]], i{{.+}} 20 // CK19: call void [[CALL17:@.+]](i{{.+}} {{[^,]+}}, i32* {{[^,]+}}) @@ -1576,17 +1603,17 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = inttoptr i[[Z]] %{{.+}} to i8* - // CK19-DAG: [[CPVAL0]] = inttoptr i[[Z]] %{{.+}}to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i[[Z]]* + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i[[Z]]* + // CK19-DAG: store i[[Z]] {{%.+}}, i[[Z]]* [[CBP0]] + // CK19-DAG: store i[[Z]] {{%.+}}, i[[Z]]* [[CP0]] // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK19-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK19-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK19-DAG: [[CBPVAL1]] = bitcast i32* [[VAR1:%.+]] to i8* - // CK19-DAG: [[CPVAL1]] = bitcast i32* [[SEC1:%.+]] to i8* + // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32** + // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** + // CK19-DAG: store i32* [[VAR1:%.+]], i32** [[CBP1]] + // CK19-DAG: store i32* [[SEC1:%.+]], i32** [[CP1]] // CK19-DAG: [[SEC1]] = getelementptr {{.*}}i32* [[VAR1]], i{{.+}} 0 // CK19: call void [[CALL18:@.+]](i{{.+}} {{[^,]+}}, i32* {{[^,]+}}) @@ -1604,20 +1631,20 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i[[Z]]* + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i[[Z]]* + // CK19-DAG: store i[[Z]] {{%.+}}, i[[Z]]* [[CBP0]] + // CK19-DAG: store i[[Z]] {{%.+}}, i[[Z]]* [[CP0]] // CK19-DAG: store i{{.+}} {{8|4}}, i{{.+}}* [[S0]] - // CK19-DAG: [[CBPVAL0]] = inttoptr i[[Z]] %{{.+}} to i8* - // CK19-DAG: [[CPVAL0]] = inttoptr i[[Z]] %{{.+}}to i8* // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[S1:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 1 - // CK19-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK19-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] + // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32** + // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** + // CK19-DAG: store i32* [[VAR1:%.+]], i32** [[CBP1]] + // CK19-DAG: store i32* [[SEC1:%.+]], i32** [[CP1]] // CK19-DAG: store i{{.+}} [[CSVAL1:%[^,]+]], i{{.+}}* [[S1]] - // CK19-DAG: [[CBPVAL1]] = bitcast i32* [[VAR1:%.+]] to i8* - // CK19-DAG: [[CPVAL1]] = bitcast i32* [[SEC1:%.+]] to i8* // CK19-DAG: [[CSVAL1]] = mul nuw i{{.+}} %{{.*}}, 4 // CK19-DAG: [[SEC1]] = getelementptr {{.*}}i32* [[VAR1]], i{{.+}} 0 @@ -1634,17 +1661,17 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = inttoptr i[[Z]] %{{.+}} to i8* - // CK19-DAG: [[CPVAL0]] = inttoptr i[[Z]] %{{.+}}to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i[[Z]]* + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i[[Z]]* + // CK19-DAG: store i[[Z]] {{%.+}}, i[[Z]]* [[CBP0]] + // CK19-DAG: store i[[Z]] {{%.+}}, i[[Z]]* [[CP0]] // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK19-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK19-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK19-DAG: [[CBPVAL1]] = bitcast i32* [[VAR1:%.+]] to i8* - // CK19-DAG: [[CPVAL1]] = bitcast i32* [[SEC1:%.+]] to i8* + // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32** + // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** + // CK19-DAG: store i32* [[VAR1:%.+]], i32** [[CBP1]] + // CK19-DAG: store i32* [[SEC1:%.+]], i32** [[CP1]] // CK19-DAG: [[SEC1]] = getelementptr {{.*}}i32* [[VAR1]], i{{.+}} 15 // CK19: call void [[CALL20:@.+]](i{{.+}} {{[^,]+}}, i32* {{[^,]+}}) @@ -1662,20 +1689,20 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i[[Z]]* + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i[[Z]]* + // CK19-DAG: store i[[Z]] {{%.+}}, i[[Z]]* [[CBP0]] + // CK19-DAG: store i[[Z]] {{%.+}}, i[[Z]]* [[CP0]] // CK19-DAG: store i{{.+}} {{8|4}}, i{{.+}}* [[S0]] - // CK19-DAG: [[CBPVAL0]] = inttoptr i[[Z]] %{{.+}} to i8* - // CK19-DAG: [[CPVAL0]] = inttoptr i[[Z]] %{{.+}}to i8* // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[S1:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 1 - // CK19-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK19-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] + // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32** + // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** + // CK19-DAG: store i32* [[VAR1:%.+]], i32** [[CBP1]] + // CK19-DAG: store i32* [[SEC1:%.+]], i32** [[CP1]] // CK19-DAG: store i{{.+}} [[CSVAL1:%[^,]+]], i{{.+}}* [[S1]] - // CK19-DAG: [[CBPVAL1]] = bitcast i32* [[VAR1:%.+]] to i8* - // CK19-DAG: [[CPVAL1]] = bitcast i32* [[SEC1:%.+]] to i8* // CK19-DAG: [[CSVAL1]] = mul nuw i{{.+}} %{{.*}}, 4 // CK19-DAG: [[SEC1]] = getelementptr {{.*}}i32* [[VAR1]], i{{.+}} %{{.+}} @@ -1692,17 +1719,17 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = inttoptr i[[Z]] %{{.+}} to i8* - // CK19-DAG: [[CPVAL0]] = inttoptr i[[Z]] %{{.+}}to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i[[Z]]* + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i[[Z]]* + // CK19-DAG: store i[[Z]] {{%.+}}, i[[Z]]* [[CBP0]] + // CK19-DAG: store i[[Z]] {{%.+}}, i[[Z]]* [[CP0]] // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK19-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK19-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK19-DAG: [[CBPVAL1]] = bitcast i32* [[VAR1:%.+]] to i8* - // CK19-DAG: [[CPVAL1]] = bitcast i32* [[SEC1:%.+]] to i8* + // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32** + // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** + // CK19-DAG: store i32* [[VAR1:%.+]], i32** [[CBP1]] + // CK19-DAG: store i32* [[SEC1:%.+]], i32** [[CP1]] // CK19-DAG: [[SEC1]] = getelementptr {{.*}}i32* [[VAR1]], i{{.+}} %{{.+}} // CK19: call void [[CALL22:@.+]](i{{.+}} {{[^,]+}}, i32* {{[^,]+}}) @@ -1719,10 +1746,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast i32* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[VAR0]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store i32* [[VAR0:%.+]], i32** [[CBP0]] + // CK19-DAG: store i32* [[VAR0]], i32** [[CP0]] // CK19: call void [[CALL23:@.+]](i32* {{[^,]+}}) #pragma omp target map(always, tofrom: a) @@ -1741,10 +1768,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [4 x [5 x [6 x i32]]]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast [4 x [5 x [6 x i32]]]* [[VAR0]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [4 x [5 x [6 x i32]]]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [4 x [5 x [6 x i32]]]** + // CK19-DAG: store [4 x [5 x [6 x i32]]]* [[VAR0:%.+]], [4 x [5 x [6 x i32]]]** [[CBP0]] + // CK19-DAG: store [4 x [5 x [6 x i32]]]* [[VAR0]], [4 x [5 x [6 x i32]]]** [[CP0]] // CK19: call void [[CALL24:@.+]]([4 x [5 x [6 x i32]]]* {{[^,]+}}) #pragma omp target map(tofrom: marr) @@ -1759,10 +1786,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [4 x [5 x [6 x i32]]]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [4 x [5 x [6 x i32]]]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store [4 x [5 x [6 x i32]]]* [[VAR0:%.+]], [4 x [5 x [6 x i32]]]** [[CBP0]] + // CK19-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK19-DAG: [[SEC0]] = getelementptr {{.*}}[6 x i32]* [[SEC00:[^,]+]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[SEC00]] = getelementptr {{.*}}[5 x [6 x i32]]* [[SEC000:[^,]+]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[SEC000]] = getelementptr {{.*}}[4 x [5 x [6 x i32]]]* [[VAR0]], i{{.+}} 0, i{{.+}} 1 @@ -1780,10 +1807,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [4 x [5 x [6 x i32]]]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [4 x [5 x [6 x i32]]]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store [4 x [5 x [6 x i32]]]* [[VAR0:%.+]], [4 x [5 x [6 x i32]]]** [[CBP0]] + // CK19-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK19-DAG: [[SEC0]] = getelementptr {{.*}}[6 x i32]* [[SEC00:[^,]+]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[SEC00]] = getelementptr {{.*}}[5 x [6 x i32]]* [[SEC000:[^,]+]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[SEC000]] = getelementptr {{.*}}[4 x [5 x [6 x i32]]]* [[VAR0]], i{{.+}} 0, i{{.+}} 1 @@ -1801,10 +1828,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [4 x [5 x [6 x i32]]]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [4 x [5 x [6 x i32]]]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK19-DAG: store [4 x [5 x [6 x i32]]]* [[VAR0:%.+]], [4 x [5 x [6 x i32]]]** [[CBP0]] + // CK19-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK19-DAG: [[SEC0]] = getelementptr {{.*}}[6 x i32]* [[SEC00:[^,]+]], i{{.+}} 0, i{{.+}} 3 // CK19-DAG: [[SEC00]] = getelementptr {{.*}}[5 x [6 x i32]]* [[SEC000:[^,]+]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[SEC000]] = getelementptr {{.*}}[4 x [5 x [6 x i32]]]* [[VAR0]], i{{.+}} 0, i{{.+}} 1 @@ -1822,20 +1849,20 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast i32*** [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32*** [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32**** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32**** + // CK19-DAG: store i32*** [[VAR0:%.+]], i32**** [[CBP0]] + // CK19-DAG: store i32*** [[SEC0:%.+]], i32**** [[CP0]] // CK19-DAG: [[VAR0]] = load i32***, i32**** [[PTR:%[^,]+]], // CK19-DAG: [[SEC0]] = getelementptr {{.*}}i32*** [[SEC00:[^,]+]], i{{.+}} 1 // CK19-DAG: [[SEC00]] = load i32***, i32**** [[PTR]], // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK19-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK19-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK19-DAG: [[CBPVAL1]] = bitcast i32*** [[SEC0]] to i8* - // CK19-DAG: [[CPVAL1]] = bitcast i32** [[SEC1:%.+]] to i8* + // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32**** + // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32*** + // CK19-DAG: store i32*** [[SEC0]], i32**** [[CBP1]] + // CK19-DAG: store i32** [[SEC1:%.+]], i32*** [[CP1]] // CK19-DAG: [[SEC1]] = getelementptr {{.*}}i32** [[SEC11:[^,]+]], i{{.+}} 2 // CK19-DAG: [[SEC11]] = load i32**, i32*** [[SEC111:%[^,]+]], // CK19-DAG: [[SEC111]] = getelementptr {{.*}}i32*** [[SEC1111:[^,]+]], i{{.+}} 1 @@ -1843,10 +1870,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 2 - // CK19-DAG: store i8* [[CBPVAL2:%[^,]+]], i8** [[BP2]] - // CK19-DAG: store i8* [[CPVAL2:%[^,]+]], i8** [[P2]] - // CK19-DAG: [[CBPVAL2]] = bitcast i32** [[SEC1]] to i8* - // CK19-DAG: [[CPVAL2]] = bitcast i32* [[SEC2:%.+]] to i8* + // CK19-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to i32*** + // CK19-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to i32** + // CK19-DAG: store i32** [[SEC1]], i32*** [[CBP2]] + // CK19-DAG: store i32* [[SEC2:%.+]], i32** [[CP2]] // CK19-DAG: [[SEC2]] = getelementptr {{.*}}i32* [[SEC22:[^,]+]], i{{.+}} 2 // CK19-DAG: [[SEC22]] = load i32*, i32** [[SEC222:%[^,]+]], // CK19-DAG: [[SEC222]] = getelementptr {{.*}}i32** [[SEC2222:[^,]+]], i{{.+}} 2 @@ -1867,20 +1894,20 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast i32*** [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast i32*** [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32**** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32**** + // CK19-DAG: store i32*** [[VAR0:%.+]], i32**** [[CBP0]] + // CK19-DAG: store i32*** [[SEC0:%.+]], i32**** [[CP0]] // CK19-DAG: [[VAR0]] = load i32***, i32**** [[PTR:%[^,]+]], // CK19-DAG: [[SEC0]] = getelementptr {{.*}}i32*** [[SEC00:[^,]+]], i{{.+}} 1 // CK19-DAG: [[SEC00]] = load i32***, i32**** [[PTR]], // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK19-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK19-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK19-DAG: [[CBPVAL1]] = bitcast i32*** [[SEC0]] to i8* - // CK19-DAG: [[CPVAL1]] = bitcast i32** [[SEC1:%.+]] to i8* + // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32**** + // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32*** + // CK19-DAG: store i32*** [[SEC0]], i32**** [[CBP1]] + // CK19-DAG: store i32** [[SEC1:%.+]], i32*** [[CP1]] // CK19-DAG: [[SEC1]] = getelementptr {{.*}}i32** [[SEC11:[^,]+]], i{{.+}} 2 // CK19-DAG: [[SEC11]] = load i32**, i32*** [[SEC111:%[^,]+]], // CK19-DAG: [[SEC111]] = getelementptr {{.*}}i32*** [[SEC1111:[^,]+]], i{{.+}} 1 @@ -1888,10 +1915,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 2 - // CK19-DAG: store i8* [[CBPVAL2:%[^,]+]], i8** [[BP2]] - // CK19-DAG: store i8* [[CPVAL2:%[^,]+]], i8** [[P2]] - // CK19-DAG: [[CBPVAL2]] = bitcast i32** [[SEC1]] to i8* - // CK19-DAG: [[CPVAL2]] = bitcast i32* [[SEC2:%.+]] to i8* + // CK19-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to i32*** + // CK19-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to i32** + // CK19-DAG: store i32** [[SEC1]], i32*** [[CBP2]] + // CK19-DAG: store i32* [[SEC2:%.+]], i32** [[CP2]] // CK19-DAG: [[SEC2]] = getelementptr {{.*}}i32* [[SEC22:[^,]+]], i{{.+}} 3 // CK19-DAG: [[SEC22]] = load i32*, i32** [[SEC222:%[^,]+]], // CK19-DAG: [[SEC222]] = getelementptr {{.*}}i32** [[SEC2222:[^,]+]], i{{.+}} 2 @@ -1917,40 +1944,42 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* inttoptr (i[[Z]] 23 to i8*), i8** [[BP0]] - // CK19-DAG: store i8* inttoptr (i[[Z]] 23 to i8*), i8** [[P0]] + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i[[Z]]* + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i[[Z]]* + // CK19-DAG: store i[[Z]] 23, i[[Z]]* [[CBP0]] + // CK19-DAG: store i[[Z]] 23, i[[Z]]* [[CP0]] // CK19-DAG: store i[[Z]] {{8|4}}, i[[Z]]* [[S0]] // // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[S1:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 1 - // CK19-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK19-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] + // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[Z]]* + // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[Z]]* + // CK19-DAG: store i[[Z]] [[VAR1:%.+]], i[[Z]]* [[CBP1]] + // CK19-DAG: store i[[Z]] [[VAR11:%.+]], i[[Z]]* [[CP1]] // CK19-DAG: store i[[Z]] {{8|4}}, i[[Z]]* [[S1]] - // CK19-DAG: [[CBPVAL1]] = inttoptr i[[Z]] [[VAR1:%.+]] to i8* - // CK19-DAG: [[CPVAL1]] = inttoptr i[[Z]] [[VAR11:%.+]] to i8* // CK19-64-DAG: [[VAR1]] = zext i32 %{{[^,]+}} to i64 // CK19-64-DAG: [[VAR11]] = zext i32 %{{[^,]+}} to i64 // // CK19-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[S2:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 2 - // CK19-DAG: store i8* [[CBPVAL2:%[^,]+]], i8** [[BP2]] - // CK19-DAG: store i8* [[CPVAL2:%[^,]+]], i8** [[P2]] + // CK19-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to i[[Z]]* + // CK19-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to i[[Z]]* + // CK19-DAG: store i[[Z]] [[VAR2:%.+]], i[[Z]]* [[CBP2]] + // CK19-DAG: store i[[Z]] [[VAR22:%.+]], i[[Z]]* [[CP2]] // CK19-DAG: store i[[Z]] {{8|4}}, i[[Z]]* [[S2]] - // CK19-DAG: [[CBPVAL2]] = inttoptr i[[Z]] [[VAR2:%.+]] to i8* - // CK19-DAG: [[CPVAL2]] = inttoptr i[[Z]] [[VAR22:%.+]] to i8* // CK19-64-DAG: [[VAR2]] = zext i32 %{{[^,]+}} to i64 // CK19-64-DAG: [[VAR22]] = zext i32 %{{[^,]+}} to i64 // // CK19-DAG: [[BP3:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 3 // CK19-DAG: [[P3:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 3 // CK19-DAG: [[S3:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 3 - // CK19-DAG: store i8* [[CBPVAL3:%[^,]+]], i8** [[BP3]] - // CK19-DAG: store i8* [[CPVAL3:%[^,]+]], i8** [[P3]] + // CK19-DAG: [[CBP3:%.+]] = bitcast i8** [[BP3]] to double** + // CK19-DAG: [[CP3:%.+]] = bitcast i8** [[P3]] to double** + // CK19-DAG: store double* [[VAR3:%.+]], double** [[CBP3]] + // CK19-DAG: store double* [[VAR3]], double** [[CP3]] // CK19-DAG: store i[[Z]] [[CSVAL3:%[^,]+]], i[[Z]]* [[S3]] - // CK19-DAG: [[CBPVAL3]] = bitcast double* [[VAR3:%.+]] to i8* - // CK19-DAG: [[CPVAL3]] = bitcast double* [[VAR3]] to i8* // CK19-DAG: [[CSVAL3]] = mul nuw i[[Z]] %{{[^,]+}}, {{8|4}} // CK19: call void [[CALL30:@.+]](i[[Z]] 23, i[[Z]] %{{[^,]+}}, i[[Z]] %{{[^,]+}}, double* %{{[^,]+}}) @@ -1966,29 +1995,31 @@ void explicit_maps_single (int ii){ // // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* inttoptr (i[[Z]] 23 to i8*), i8** [[BP0]] - // CK19-DAG: store i8* inttoptr (i[[Z]] 23 to i8*), i8** [[P0]] + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i[[Z]]* + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i[[Z]]* + // CK19-DAG: store i[[Z]] 23, i[[Z]]* [[CBP0]] + // CK19-DAG: store i[[Z]] 23, i[[Z]]* [[CP0]] // // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK19-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK19-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK19-DAG: [[CBPVAL1]] = inttoptr i[[Z]] [[VAR1:%.+]] to i8* - // CK19-DAG: [[CPVAL1]] = inttoptr i[[Z]] [[VAR11:%.+]] to i8* + // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[Z]]* + // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[Z]]* + // CK19-DAG: store i[[Z]] [[VAR1:%.+]], i[[Z]]* [[CBP1]] + // CK19-DAG: store i[[Z]] [[VAR11:%.+]], i[[Z]]* [[CP1]] // // CK19-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 2 - // CK19-DAG: store i8* [[CBPVAL2:%[^,]+]], i8** [[BP2]] - // CK19-DAG: store i8* [[CPVAL2:%[^,]+]], i8** [[P2]] - // CK19-DAG: [[CBPVAL2]] = inttoptr i[[Z]] [[VAR2:%.+]] to i8* - // CK19-DAG: [[CPVAL2]] = inttoptr i[[Z]] [[VAR22:%.+]] to i8* + // CK19-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to i[[Z]]* + // CK19-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to i[[Z]]* + // CK19-DAG: store i[[Z]] [[VAR2:%.+]], i[[Z]]* [[CBP2]] + // CK19-DAG: store i[[Z]] [[VAR22:%.+]], i[[Z]]* [[CP2]] // // CK19-DAG: [[BP3:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 3 // CK19-DAG: [[P3:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 3 - // CK19-DAG: store i8* [[CBPVAL3:%[^,]+]], i8** [[BP3]] - // CK19-DAG: store i8* [[CPVAL3:%[^,]+]], i8** [[P3]] - // CK19-DAG: [[CBPVAL3]] = bitcast double* [[VAR3:%.+]] to i8* - // CK19-DAG: [[CPVAL3]] = bitcast double* [[SEC3:%.+]] to i8* + // CK19-DAG: [[CBP3:%.+]] = bitcast i8** [[BP3]] to double** + // CK19-DAG: [[CP3:%.+]] = bitcast i8** [[P3]] to double** + // CK19-DAG: store double* [[VAR3:%.+]], double** [[CBP3]] + // CK19-DAG: store double* [[SEC3:%.+]], double** [[CP3]] // CK19-DAG: [[SEC3]] = getelementptr {{.*}}double* [[SEC33:%.+]], i[[Z]] 0 // CK19-DAG: [[SEC33]] = getelementptr {{.*}}double* [[SEC333:%.+]], i[[Z]] [[IDX3:%.+]] // CK19-DAG: [[IDX3]] = mul nsw i[[Z]] %{{[^,]+}}, %{{[^,]+}} @@ -2013,10 +2044,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [11 x [12 x [13 x double]]]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast [11 x [12 x [13 x double]]]* [[VAR0]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [11 x [12 x [13 x double]]]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [11 x [12 x [13 x double]]]** + // CK19-DAG: store [11 x [12 x [13 x double]]]* [[VAR0:%.+]], [11 x [12 x [13 x double]]]** [[CBP0]] + // CK19-DAG: store [11 x [12 x [13 x double]]]* [[VAR0]], [11 x [12 x [13 x double]]]** [[CP0]] // CK19: call void [[CALL32:@.+]]([11 x [12 x [13 x double]]]* {{[^,]+}}) #pragma omp target map(marras) @@ -2031,10 +2062,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [11 x [12 x [13 x double]]]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast [12 x [13 x double]]* [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [11 x [12 x [13 x double]]]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [12 x [13 x double]]** + // CK19-DAG: store [11 x [12 x [13 x double]]]* [[VAR0:%.+]], [11 x [12 x [13 x double]]]** [[CBP0]] + // CK19-DAG: store [12 x [13 x double]]* [[SEC0:%.+]], [12 x [13 x double]]** [[CP0]] // CK19-DAG: [[SEC0]] = getelementptr {{.+}}[11 x [12 x [13 x double]]]* [[VAR0]], i[[Z]] 0, i[[Z]] 0 // CK19: call void [[CALL33:@.+]]([11 x [12 x [13 x double]]]* {{[^,]+}}) @@ -2050,10 +2081,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [11 x [12 x [13 x double]]]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast [12 x [13 x double]]* [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [11 x [12 x [13 x double]]]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [12 x [13 x double]]** + // CK19-DAG: store [11 x [12 x [13 x double]]]* [[VAR0:%.+]], [11 x [12 x [13 x double]]]** [[CBP0]] + // CK19-DAG: store [12 x [13 x double]]* [[SEC0:%.+]], [12 x [13 x double]]** [[CP0]] // CK19-DAG: [[SEC0]] = getelementptr {{.+}}[11 x [12 x [13 x double]]]* [[VAR0]], i[[Z]] 0, i[[Z]] 0 // CK19: call void [[CALL34:@.+]]([11 x [12 x [13 x double]]]* {{[^,]+}}) @@ -2072,11 +2103,11 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [11 x [12 x [13 x double]]]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [13 x double]** + // CK19-DAG: store [11 x [12 x [13 x double]]]* [[VAR0:%.+]], [11 x [12 x [13 x double]]]** [[CBP0]] + // CK19-DAG: store [13 x double]* [[SEC0:%.+]], [13 x double]** [[CP0]] // CK19-DAG: store i[[Z]] [[CSVAL0:%[^,]+]], i[[Z]]* [[S0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [11 x [12 x [13 x double]]]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast [13 x double]* [[SEC0:%.+]] to i8* // CK19-DAG: [[SEC0]] = getelementptr {{.+}}[12 x [13 x double]]* [[SEC00:%[^,]+]], i[[Z]] 0, i[[Z]] 0 // CK19-DAG: [[SEC00]] = getelementptr {{.+}}[11 x [12 x [13 x double]]]* [[VAR0]], i[[Z]] 0, i[[Z]] 1 // CK19-DAG: [[CSVAL0]] = mul nuw i[[Z]] %{{[^,]+}}, 104 @@ -2094,10 +2125,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [11 x [12 x [13 x double]]]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast [13 x double]* [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [11 x [12 x [13 x double]]]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [13 x double]** + // CK19-DAG: store [11 x [12 x [13 x double]]]* [[VAR0:%.+]], [11 x [12 x [13 x double]]]** [[CBP0]] + // CK19-DAG: store [13 x double]* [[SEC0:%.+]], [13 x double]** [[CP0]] // CK19-DAG: [[SEC0]] = getelementptr {{.+}}[13 x double]* [[SEC00:%[^,]+]], i{{.+}} 0 // CK19-DAG: [[SEC00]] = getelementptr {{.+}}[12 x [13 x double]]* [[SEC000:%[^,]+]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[SEC000]] = getelementptr {{.+}}[11 x [12 x [13 x double]]]* [[VAR0]], i{{.+}} 0, i{{.+}} 0 @@ -2117,27 +2148,29 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* inttoptr (i[[Z]] 11 to i8*), i8** [[BP0]] - // CK19-DAG: store i8* inttoptr (i[[Z]] 11 to i8*), i8** [[P0]] + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i[[Z]]* + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i[[Z]]* + // CK19-DAG: store i[[Z]] 11, i[[Z]]* [[CBP0]] + // CK19-DAG: store i[[Z]] 11, i[[Z]]* [[CP0]] // CK19-DAG: store i[[Z]] {{8|4}}, i[[Z]]* [[S0]] // // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[S1:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 1 - // CK19-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK19-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] + // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[Z]]* + // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[Z]]* + // CK19-DAG: store i[[Z]] [[VAR1:%.+]], i[[Z]]* [[CBP1]] + // CK19-DAG: store i[[Z]] [[VAR11:%.+]], i[[Z]]* [[CP1]] // CK19-DAG: store i[[Z]] {{8|4}}, i[[Z]]* [[S1]] - // CK19-DAG: [[CBPVAL1]] = inttoptr i[[Z]] [[VAR1:%.+]] to i8* - // CK19-DAG: [[CPVAL1]] = inttoptr i[[Z]] [[VAR11:%.+]] to i8* // // CK19-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[S2:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 2 - // CK19-DAG: store i8* [[CBPVAL2:%[^,]+]], i8** [[BP2]] - // CK19-DAG: store i8* [[CPVAL2:%[^,]+]], i8** [[P2]] + // CK19-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to [13 x double]** + // CK19-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to [13 x double]** + // CK19-DAG: store [13 x double]* [[VAR2:%.+]], [13 x double]** [[CBP2]] + // CK19-DAG: store [13 x double]* [[VAR2]], [13 x double]** [[CP2]] // CK19-DAG: store i[[Z]] [[CSVAL2:%[^,]+]], i[[Z]]* [[S2]] - // CK19-DAG: [[CBPVAL2]] = bitcast [13 x double]* [[VAR2:%.+]] to i8* - // CK19-DAG: [[CPVAL2]] = bitcast [13 x double]* [[VAR2]] to i8* // CK19-DAG: [[CSVAL2]] = mul nuw i[[Z]] %{{[^,]+}}, 104 // CK19: call void [[CALL37:@.+]](i[[Z]] 11, i[[Z]] %{{[^,]+}}, [13 x double]* %{{[^,]+}}) @@ -2155,27 +2188,29 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* inttoptr (i[[Z]] 11 to i8*), i8** [[BP0]] - // CK19-DAG: store i8* inttoptr (i[[Z]] 11 to i8*), i8** [[P0]] + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i[[Z]]* + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i[[Z]]* + // CK19-DAG: store i[[Z]] 11, i[[Z]]* [[CBP0]] + // CK19-DAG: store i[[Z]] 11, i[[Z]]* [[CP0]] // CK19-DAG: store i[[Z]] {{8|4}}, i[[Z]]* [[S0]] // // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[S1:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 1 - // CK19-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK19-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] + // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[Z]]* + // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[Z]]* + // CK19-DAG: store i[[Z]] [[VAR1:%.+]], i[[Z]]* [[CBP1]] + // CK19-DAG: store i[[Z]] [[VAR11:%.+]], i[[Z]]* [[CP1]] // CK19-DAG: store i[[Z]] {{8|4}}, i[[Z]]* [[S1]] - // CK19-DAG: [[CBPVAL1]] = inttoptr i[[Z]] [[VAR1:%.+]] to i8* - // CK19-DAG: [[CPVAL1]] = inttoptr i[[Z]] [[VAR11:%.+]] to i8* // // CK19-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[S2:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 2 - // CK19-DAG: store i8* [[CBPVAL2:%[^,]+]], i8** [[BP2]] - // CK19-DAG: store i8* [[CPVAL2:%[^,]+]], i8** [[P2]] + // CK19-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to [13 x double]** + // CK19-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to [13 x double]** + // CK19-DAG: store [13 x double]* [[VAR2:%.+]], [13 x double]** [[CBP2]] + // CK19-DAG: store [13 x double]* [[SEC2:%.+]], [13 x double]** [[CP2]] // CK19-DAG: store i[[Z]] [[CSVAL2:%[^,]+]], i[[Z]]* [[S2]] - // CK19-DAG: [[CBPVAL2]] = bitcast [13 x double]* [[VAR2:%.+]] to i8* - // CK19-DAG: [[CPVAL2]] = bitcast [13 x double]* [[SEC2:%.+]] to i8* // CK19-DAG: [[SEC2]] = getelementptr {{.+}}[13 x double]* [[VAR2]], i[[Z]] [[SEC22:%[^,]+]] // CK19-DAG: [[SEC22]] = mul nsw i[[Z]] 0, %{{[^,]+}} // CK19-DAG: [[CSVAL2]] = mul nuw i[[Z]] %{{[^,]+}}, 104 @@ -2195,27 +2230,29 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* inttoptr (i[[Z]] 11 to i8*), i8** [[BP0]] - // CK19-DAG: store i8* inttoptr (i[[Z]] 11 to i8*), i8** [[P0]] + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i[[Z]]* + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i[[Z]]* + // CK19-DAG: store i[[Z]] 11, i[[Z]]* [[CBP0]] + // CK19-DAG: store i[[Z]] 11, i[[Z]]* [[CP0]] // CK19-DAG: store i[[Z]] {{8|4}}, i[[Z]]* [[S0]] // // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[S1:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 1 - // CK19-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK19-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] + // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[Z]]* + // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[Z]]* + // CK19-DAG: store i[[Z]] [[VAR1:%.+]], i[[Z]]* [[CBP1]] + // CK19-DAG: store i[[Z]] [[VAR11:%.+]], i[[Z]]* [[CP1]] // CK19-DAG: store i[[Z]] {{8|4}}, i[[Z]]* [[S1]] - // CK19-DAG: [[CBPVAL1]] = inttoptr i[[Z]] [[VAR1:%.+]] to i8* - // CK19-DAG: [[CPVAL1]] = inttoptr i[[Z]] [[VAR11:%.+]] to i8* // // CK19-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[S2:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 2 - // CK19-DAG: store i8* [[CBPVAL2:%[^,]+]], i8** [[BP2]] - // CK19-DAG: store i8* [[CPVAL2:%[^,]+]], i8** [[P2]] + // CK19-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to [13 x double]** + // CK19-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to [13 x double]** + // CK19-DAG: store [13 x double]* [[VAR2:%.+]], [13 x double]** [[CBP2]] + // CK19-DAG: store [13 x double]* [[SEC2:%.+]], [13 x double]** [[CP2]] // CK19-DAG: store i[[Z]] [[CSVAL2:%[^,]+]], i[[Z]]* [[S2]] - // CK19-DAG: [[CBPVAL2]] = bitcast [13 x double]* [[VAR2:%.+]] to i8* - // CK19-DAG: [[CPVAL2]] = bitcast [13 x double]* [[SEC2:%.+]] to i8* // CK19-DAG: [[SEC2]] = getelementptr {{.+}}[13 x double]* [[VAR2]], i[[Z]] [[SEC22:%[^,]+]] // CK19-DAG: [[SEC22]] = mul nsw i[[Z]] 0, %{{[^,]+}} // CK19-DAG: [[CSVAL2]] = mul nuw i[[Z]] %{{[^,]+}}, 104 @@ -2235,27 +2272,29 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* inttoptr (i[[Z]] 11 to i8*), i8** [[BP0]] - // CK19-DAG: store i8* inttoptr (i[[Z]] 11 to i8*), i8** [[P0]] + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i[[Z]]* + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i[[Z]]* + // CK19-DAG: store i[[Z]] 11, i[[Z]]* [[CBP0]] + // CK19-DAG: store i[[Z]] 11, i[[Z]]* [[CP0]] // CK19-DAG: store i[[Z]] {{8|4}}, i[[Z]]* [[S0]] // // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[S1:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 1 - // CK19-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK19-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] + // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[Z]]* + // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[Z]]* + // CK19-DAG: store i[[Z]] [[VAR1:%.+]], i[[Z]]* [[CBP1]] + // CK19-DAG: store i[[Z]] [[VAR11:%.+]], i[[Z]]* [[CP1]] // CK19-DAG: store i[[Z]] {{8|4}}, i[[Z]]* [[S1]] - // CK19-DAG: [[CBPVAL1]] = inttoptr i[[Z]] [[VAR1:%.+]] to i8* - // CK19-DAG: [[CPVAL1]] = inttoptr i[[Z]] [[VAR11:%.+]] to i8* // // CK19-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[S2:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 2 - // CK19-DAG: store i8* [[CBPVAL2:%[^,]+]], i8** [[BP2]] - // CK19-DAG: store i8* [[CPVAL2:%[^,]+]], i8** [[P2]] + // CK19-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to [13 x double]** + // CK19-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to [13 x double]** + // CK19-DAG: store [13 x double]* [[VAR2:%.+]], [13 x double]** [[CBP2]] + // CK19-DAG: store [13 x double]* [[SEC2:%.+]], [13 x double]** [[CP2]] // CK19-DAG: store i[[Z]] [[CSVAL2:%[^,]+]], i[[Z]]* [[S2]] - // CK19-DAG: [[CBPVAL2]] = bitcast [13 x double]* [[VAR2:%.+]] to i8* - // CK19-DAG: [[CPVAL2]] = bitcast [13 x double]* [[SEC2:%.+]] to i8* // CK19-DAG: [[SEC2]] = getelementptr {{.+}}[13 x double]* [[SEC22:%[^,]+]], i[[Z]] 0 // CK19-DAG: [[SEC22]] = getelementptr {{.+}}[13 x double]* [[VAR2]], i[[Z]] [[SEC222:%[^,]+]] // CK19-DAG: [[SEC222]] = mul nsw i[[Z]] 1, %{{[^,]+}} @@ -2273,22 +2312,24 @@ void explicit_maps_single (int ii){ // // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* inttoptr (i[[Z]] 11 to i8*), i8** [[BP0]] - // CK19-DAG: store i8* inttoptr (i[[Z]] 11 to i8*), i8** [[P0]] + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i[[Z]]* + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i[[Z]]* + // CK19-DAG: store i[[Z]] 11, i[[Z]]* [[CBP0]] + // CK19-DAG: store i[[Z]] 11, i[[Z]]* [[CP0]] // // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK19-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK19-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK19-DAG: [[CBPVAL1]] = inttoptr i[[Z]] [[VAR1:%.+]] to i8* - // CK19-DAG: [[CPVAL1]] = inttoptr i[[Z]] [[VAR11:%.+]] to i8* + // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[Z]]* + // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[Z]]* + // CK19-DAG: store i[[Z]] [[VAR1:%.+]], i[[Z]]* [[CBP1]] + // CK19-DAG: store i[[Z]] [[VAR11:%.+]], i[[Z]]* [[CP1]] // // CK19-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 2 - // CK19-DAG: store i8* [[CBPVAL2:%[^,]+]], i8** [[BP2]] - // CK19-DAG: store i8* [[CPVAL2:%[^,]+]], i8** [[P2]] - // CK19-DAG: [[CBPVAL2]] = bitcast [13 x double]* [[VAR2:%.+]] to i8* - // CK19-DAG: [[CPVAL2]] = bitcast [13 x double]* [[SEC2:%.+]] to i8* + // CK19-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to [13 x double]** + // CK19-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to [13 x double]** + // CK19-DAG: store [13 x double]* [[VAR2:%.+]], [13 x double]** [[CBP2]] + // CK19-DAG: store [13 x double]* [[SEC2:%.+]], [13 x double]** [[CP2]] // CK19-DAG: [[SEC2]] = getelementptr {{.+}}[13 x double]* [[SEC22:%[^,]+]], i[[Z]] 0 // CK19-DAG: [[SEC22]] = getelementptr {{.+}}[13 x double]* [[VAR2]], i[[Z]] [[SEC222:%[^,]+]] // CK19-DAG: [[SEC222]] = mul nsw i[[Z]] 0, %{{[^,]+}} @@ -2306,20 +2347,20 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK19-DAG: [[CBPVAL0]] = bitcast double*** [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast double*** [[SEC0:%.+]] to i8* + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to double**** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to double**** + // CK19-DAG: store double*** [[VAR0:%.+]], double**** [[CBP0]] + // CK19-DAG: store double*** [[SEC0:%.+]], double**** [[CP0]] // CK19-DAG: [[VAR0]] = load double***, double**** [[PTR:%[^,]+]], // CK19-DAG: [[SEC0]] = getelementptr {{.*}}double*** [[SEC00:[^,]+]], i{{.+}} 0 // CK19-DAG: [[SEC00]] = load double***, double**** [[PTR]], // CK19-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK19-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK19-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK19-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK19-DAG: [[CBPVAL1]] = bitcast double*** [[SEC0]] to i8* - // CK19-DAG: [[CPVAL1]] = bitcast double** [[SEC1:%.+]] to i8* + // CK19-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double**** + // CK19-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double*** + // CK19-DAG: store double*** [[SEC0]], double**** [[CBP1]] + // CK19-DAG: store double** [[SEC1:%.+]], double*** [[CP1]] // CK19-DAG: [[SEC1]] = getelementptr {{.*}}double** [[SEC11:[^,]+]], i{{.+}} 2 // CK19-DAG: [[SEC11]] = load double**, double*** [[SEC111:%[^,]+]], // CK19-DAG: [[SEC111]] = getelementptr {{.*}}double*** [[SEC1111:[^,]+]], i{{.+}} 0 @@ -2327,10 +2368,10 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 2 // CK19-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 2 - // CK19-DAG: store i8* [[CBPVAL2:%[^,]+]], i8** [[BP2]] - // CK19-DAG: store i8* [[CPVAL2:%[^,]+]], i8** [[P2]] - // CK19-DAG: [[CBPVAL2]] = bitcast double** [[SEC1]] to i8* - // CK19-DAG: [[CPVAL2]] = bitcast double* [[SEC2:%.+]] to i8* + // CK19-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to double*** + // CK19-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to double** + // CK19-DAG: store double** [[SEC1]], double*** [[CBP2]] + // CK19-DAG: store double* [[SEC2:%.+]], double** [[CP2]] // CK19-DAG: [[SEC2]] = getelementptr {{.*}}double* [[SEC22:[^,]+]], i{{.+}} 0 // CK19-DAG: [[SEC22]] = load double*, double** [[SEC222:%[^,]+]], // CK19-DAG: [[SEC222]] = getelementptr {{.*}}double** [[SEC2222:[^,]+]], i{{.+}} 2 @@ -2354,11 +2395,11 @@ void explicit_maps_single (int ii){ // CK19-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK19-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK19-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK19-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] + // CK19-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [11 x [12 x [13 x double]]]** + // CK19-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [13 x double]** + // CK19-DAG: store [11 x [12 x [13 x double]]]* [[VAR0:%.+]], [11 x [12 x [13 x double]]]** [[CBP0]] + // CK19-DAG: store [13 x double]* [[SEC0:%.+]], [13 x double]** [[CP0]] // CK19-DAG: store i[[Z]] [[CSVAL0:%[^,]+]], i[[Z]]* [[S0]] - // CK19-DAG: [[CBPVAL0]] = bitcast [11 x [12 x [13 x double]]]* [[VAR0:%.+]] to i8* - // CK19-DAG: [[CPVAL0]] = bitcast [13 x double]* [[SEC0:%.+]] to i8* // CK19-DAG: [[SEC0]] = getelementptr {{.+}}[12 x [13 x double]]* [[SEC00:%[^,]+]], i[[Z]] 0, i[[Z]] 0 // CK19-DAG: [[SEC00]] = getelementptr {{.+}}[11 x [12 x [13 x double]]]* [[VAR0]], i[[Z]] 0, i[[Z]] 1 // CK19-DAG: [[CSVAL0]] = mul nuw i[[Z]] %{{[^,]+}}, 104 @@ -2372,6 +2413,7 @@ void explicit_maps_single (int ii){ } // CK19: define {{.+}}[[CALL00]] +// CK19: define {{.+}}[[CALL00n]] // CK19: define {{.+}}[[CALL01]] // CK19: define {{.+}}[[CALL02]] // CK19: define {{.+}}[[CALL03]] @@ -2453,10 +2495,10 @@ void explicit_maps_references_and_function_args (int a, float b, int (&c)[10], f // CK20-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK20-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK20-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK20-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK20-DAG: [[CBPVAL0]] = bitcast i32* [[RVAR0:%.+]] to i8* - // CK20-DAG: [[CPVAL0]] = bitcast i32* [[RVAR00:%.+]] to i8* + // CK20-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK20-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK20-DAG: store i32* [[RVAR0:%.+]], i32** [[CBP0]] + // CK20-DAG: store i32* [[RVAR00:%.+]], i32** [[CP0]] // CK20-DAG: [[RVAR0]] = load i32*, i32** [[VAR0:%[^,]+]] // CK20-DAG: [[RVAR00]] = load i32*, i32** [[VAR0]] @@ -2473,10 +2515,10 @@ void explicit_maps_references_and_function_args (int a, float b, int (&c)[10], f // CK20-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK20-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK20-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK20-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK20-DAG: [[CBPVAL0]] = bitcast [10 x i32]* [[RVAR0:%.+]] to i8* - // CK20-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK20-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [10 x i32]** + // CK20-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK20-DAG: store [10 x i32]* [[RVAR0:%.+]], [10 x i32]** [[CBP0]] + // CK20-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK20-DAG: [[SEC0]] = getelementptr {{.*}}[10 x i32]* [[RVAR00:%.+]], i{{.+}} 0, i{{.+}} 0 // CK20-DAG: [[RVAR0]] = load [10 x i32]*, [10 x i32]** [[VAR0:%[^,]+]] // CK20-DAG: [[RVAR00]] = load [10 x i32]*, [10 x i32]** [[VAR0]] @@ -2494,10 +2536,10 @@ void explicit_maps_references_and_function_args (int a, float b, int (&c)[10], f // CK20-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK20-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK20-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK20-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK20-DAG: [[CBPVAL0]] = bitcast float* [[VAR0:%.+]] to i8* - // CK20-DAG: [[CPVAL0]] = bitcast float* [[VAR0]] to i8* + // CK20-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to float** + // CK20-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to float** + // CK20-DAG: store float* [[VAR0:%.+]], float** [[CBP0]] + // CK20-DAG: store float* [[VAR0]], float** [[CP0]] // CK20: call void [[CALL02:@.+]](float* {{[^,]+}}) #pragma omp target map(from:b) @@ -2512,10 +2554,10 @@ void explicit_maps_references_and_function_args (int a, float b, int (&c)[10], f // CK20-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK20-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK20-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK20-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK20-DAG: [[CBPVAL0]] = bitcast float* [[RVAR0:%.+]] to i8* - // CK20-DAG: [[CPVAL0]] = bitcast float* [[SEC0:%.+]] to i8* + // CK20-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to float** + // CK20-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to float** + // CK20-DAG: store float* [[RVAR0:%.+]], float** [[CBP0]] + // CK20-DAG: store float* [[SEC0:%.+]], float** [[CP0]] // CK20-DAG: [[RVAR0]] = load float*, float** [[VAR0:%[^,]+]] // CK20-DAG: [[SEC0]] = getelementptr {{.*}}float* [[RVAR00:%.+]], i{{.+}} 2 // CK20-DAG: [[RVAR00]] = load float*, float** [[VAR0]] @@ -2580,10 +2622,10 @@ struct CC { // CK21-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK21-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK21-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK21-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK21-DAG: [[CBPVAL0]] = bitcast [[ST]]* [[VAR0:%.+]] to i8* - // CK21-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK21-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK21-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK21-DAG: store [[ST]]* [[VAR0:%.+]], [[ST]]** [[CBP0]] + // CK21-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK21-DAG: [[SEC0]] = getelementptr {{.*}}[[ST]]* [[VAR0:%.+]], i{{.+}} 0, i{{.+}} 0 // CK21: call void [[CALL00:@.+]]([[ST]]* {{[^,]+}}) @@ -2599,10 +2641,10 @@ struct CC { // CK21-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK21-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK21-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK21-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK21-DAG: [[CBPVAL0]] = bitcast i32* [[RVAR0:%.+]] to i8* - // CK21-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK21-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK21-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK21-DAG: store i32* [[RVAR0:%.+]], i32** [[CBP0]] + // CK21-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK21-DAG: [[RVAR0]] = load i32*, i32** [[VAR0:%[^,]+]] // CK21-DAG: [[SEC0]] = getelementptr {{.*}}i32* [[RVAR00:%.+]], i{{.+}} 0 // CK21-DAG: [[RVAR00]] = load i32*, i32** [[VAR0]] @@ -2620,18 +2662,18 @@ struct CC { // CK21-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK21-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK21-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK21-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK21-DAG: [[CBPVAL0]] = bitcast [[ST]]* [[VAR0:%.+]] to i8* - // CK21-DAG: [[CPVAL0]] = bitcast float** [[SEC0:%.+]] to i8* + // CK21-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK21-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to float*** + // CK21-DAG: store [[ST]]* [[VAR0:%.+]], [[ST]]** [[CBP0]] + // CK21-DAG: store float** [[SEC0:%.+]], float*** [[CP0]] // CK21-DAG: [[SEC0]] = getelementptr {{.*}}[[ST]]* [[VAR0]], i{{.+}} 0, i{{.+}} 2 // CK21-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK21-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK21-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK21-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK21-DAG: [[CBPVAL1]] = bitcast float** [[SEC0]] to i8* - // CK21-DAG: [[CPVAL1]] = bitcast float* [[SEC1:%.+]] to i8* + // CK21-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to float*** + // CK21-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to float** + // CK21-DAG: store float** [[SEC0]], float*** [[CBP1]] + // CK21-DAG: store float* [[SEC1:%.+]], float** [[CP1]] // CK21-DAG: [[SEC1]] = getelementptr {{.*}}float* [[RVAR1:%[^,]+]], i{{.+}} 123 // CK21-DAG: [[RVAR1]] = load float*, float** [[SEC1_:%[^,]+]] // CK21-DAG: [[SEC1_]] = getelementptr {{.*}}[[ST]]* [[VAR0]], i{{.+}} 0, i{{.+}} 2 @@ -2649,10 +2691,10 @@ struct CC { // CK21-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK21-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK21-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK21-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK21-DAG: [[CBPVAL0]] = bitcast [123 x float]* [[VAR0:%.+]] to i8* - // CK21-DAG: [[CPVAL0]] = bitcast [123 x float]* [[VAR0]] to i8* + // CK21-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [123 x float]** + // CK21-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [123 x float]** + // CK21-DAG: store [123 x float]* [[VAR0:%.+]], [123 x float]** [[CBP0]] + // CK21-DAG: store [123 x float]* [[VAR0]], [123 x float]** [[CP0]] // CK21: call void [[CALL03:@.+]]([123 x float]* {{[^,]+}}) #pragma omp target map(from:la) @@ -2667,10 +2709,10 @@ struct CC { // CK21-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK21-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK21-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK21-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK21-DAG: [[CBPVAL0]] = bitcast i32* [[VAR0:%.+]] to i8* - // CK21-DAG: [[CPVAL0]] = bitcast i32* [[VAR0]] to i8* + // CK21-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK21-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK21-DAG: store i32* [[VAR0:%.+]], i32** [[CBP0]] + // CK21-DAG: store i32* [[VAR0]], i32** [[CP0]] // CK21: call void [[CALL04:@.+]](i32* {{[^,]+}}) #pragma omp target map(from:arg) @@ -2686,18 +2728,18 @@ struct CC { // CK21-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK21-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK21-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK21-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK21-DAG: [[CBPVAL0]] = bitcast [[ST]]* [[VAR0:%.+]] to i8* - // CK21-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK21-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK21-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK21-DAG: store [[ST]]* [[VAR0:%.+]], [[ST]]** [[CBP0]] + // CK21-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK21-DAG: [[SEC0]] = getelementptr {{.*}}[[ST]]* [[VAR0]], i{{.+}} 0, i{{.+}} 0 // CK21-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK21-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK21-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK21-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK21-DAG: [[CBPVAL1]] = bitcast [[ST]]* [[VAR1:%.+]] to i8* - // CK21-DAG: [[CPVAL1]] = bitcast i32* [[SEC1:%.+]] to i8* + // CK21-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[ST]]** + // CK21-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** + // CK21-DAG: store [[ST]]* [[VAR1:%.+]], [[ST]]** [[CBP1]] + // CK21-DAG: store i32* [[SEC1:%.+]], i32** [[CP1]] // CK21-DAG: [[SEC1]] = getelementptr {{.*}}[[ST]]* [[VAR0]], i{{.+}} 0, i{{.+}} 1 // CK21: call void [[CALL05:@.+]]([[ST]]* {{[^,]+}}) @@ -2809,8 +2851,10 @@ int explicit_maps_globals(void){ // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK22-DAG: store i8* bitcast (i32* @a to i8*), i8** [[BP0]] - // CK22-DAG: store i8* bitcast (i32* @a to i8*), i8** [[P0]] + // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK22-DAG: store i32* @a, i32** [[CBP0]] + // CK22-DAG: store i32* @a, i32** [[CP0]] // CK22: call void [[CALL00:@.+]](i32* {{[^,]+}}) #pragma omp target map(a) @@ -2823,8 +2867,10 @@ int explicit_maps_globals(void){ // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK22-DAG: store i8* bitcast ([100 x i32]* @c to i8*), i8** [[BP0]] - // CK22-DAG: store i8* bitcast ([100 x i32]* @c to i8*), i8** [[P0]] + // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x i32]** + // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [100 x i32]** + // CK22-DAG: store [100 x i32]* @c, [100 x i32]** [[CBP0]] + // CK22-DAG: store [100 x i32]* @c, [100 x i32]** [[CP0]] // CK22: call void [[CALL01:@.+]]([100 x i32]* {{[^,]+}}) #pragma omp target map(c) @@ -2837,8 +2883,10 @@ int explicit_maps_globals(void){ // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK22-DAG: store i8* bitcast (i32** @d to i8*), i8** [[BP0]] - // CK22-DAG: store i8* bitcast (i32** @d to i8*), i8** [[P0]] + // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32*** + // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32*** + // CK22-DAG: store i32** @d, i32*** [[CBP0]] + // CK22-DAG: store i32** @d, i32*** [[CP0]] // CK22: call void [[CALL02:@.+]](i32** {{[^,]+}}) #pragma omp target map(d) @@ -2851,8 +2899,10 @@ int explicit_maps_globals(void){ // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK22-DAG: store i8* bitcast ([100 x i32]* @c to i8*), i8** [[BP0]] - // CK22-DAG: store i8* bitcast (i32* getelementptr inbounds ([100 x i32], [100 x i32]* @c, i{{.+}} 0, i{{.+}} 1) to i8*), i8** [[P0]] + // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x i32]** + // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK22-DAG: store [100 x i32]* @c, [100 x i32]** [[CBP0]] + // CK22-DAG: store i32* getelementptr inbounds ([100 x i32], [100 x i32]* @c, i{{.+}} 0, i{{.+}} 1), i32** [[CP0]] // CK22: call void [[CALL03:@.+]]([100 x i32]* {{[^,]+}}) #pragma omp target map(c[1:4]) @@ -2865,10 +2915,10 @@ int explicit_maps_globals(void){ // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK22-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK22-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK22-DAG: [[CBPVAL0]] = bitcast i32* [[RVAR0:%.+]] to i8* - // CK22-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK22-DAG: store i32* [[RVAR0:%.+]], i32** [[CBP0]] + // CK22-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK22-DAG: [[RVAR0]] = load i32*, i32** @d // CK22-DAG: [[SEC0]] = getelementptr {{.*}}i32* [[RVAR00:%.+]], i{{.+}} 2 // CK22-DAG: [[RVAR00]] = load i32*, i32** @d @@ -2884,8 +2934,10 @@ int explicit_maps_globals(void){ // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK22-DAG: store i8* bitcast ([[ST]]* @sa to i8*), i8** [[BP0]] - // CK22-DAG: store i8* bitcast ([[ST]]* @sa to i8*), i8** [[P0]] + // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[ST]]** + // CK22-DAG: store [[ST]]* @sa, [[ST]]** [[CBP0]] + // CK22-DAG: store [[ST]]* @sa, [[ST]]** [[CP0]] // CK22: call void [[CALL05:@.+]]([[ST]]* {{[^,]+}}) #pragma omp target map(sa) @@ -2898,8 +2950,10 @@ int explicit_maps_globals(void){ // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK22-DAG: store i8* bitcast ([100 x [[ST]]]* @sc to i8*), i8** [[BP0]] - // CK22-DAG: store i8* bitcast ([100 x [[ST]]]* @sc to i8*), i8** [[P0]] + // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x [[ST]]]** + // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [100 x [[ST]]]** + // CK22-DAG: store [100 x [[ST]]]* @sc, [100 x [[ST]]]** [[CBP0]] + // CK22-DAG: store [100 x [[ST]]]* @sc, [100 x [[ST]]]** [[CP0]] // CK22: call void [[CALL06:@.+]]([100 x [[ST]]]* {{[^,]+}}) #pragma omp target map(sc) @@ -2912,8 +2966,10 @@ int explicit_maps_globals(void){ // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK22-DAG: store i8* bitcast ([[ST]]** @sd to i8*), i8** [[BP0]] - // CK22-DAG: store i8* bitcast ([[ST]]** @sd to i8*), i8** [[P0]] + // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]*** + // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[ST]]*** + // CK22-DAG: store [[ST]]** @sd, [[ST]]*** [[CBP0]] + // CK22-DAG: store [[ST]]** @sd, [[ST]]*** [[CP0]] // CK22: call void [[CALL07:@.+]]([[ST]]** {{[^,]+}}) #pragma omp target map(sd) @@ -2926,8 +2982,10 @@ int explicit_maps_globals(void){ // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK22-DAG: store i8* bitcast ([100 x [[ST]]]* @sc to i8*), i8** [[BP0]] - // CK22-DAG: store i8* bitcast ([[ST]]* getelementptr inbounds ([100 x [[ST]]], [100 x [[ST]]]* @sc, i{{.+}} 0, i{{.+}} 1) to i8*), i8** [[P0]] + // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x [[ST]]]** + // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[ST]]** + // CK22-DAG: store [100 x [[ST]]]* @sc, [100 x [[ST]]]** [[CBP0]] + // CK22-DAG: store [[ST]]* getelementptr inbounds ([100 x [[ST]]], [100 x [[ST]]]* @sc, i{{.+}} 0, i{{.+}} 1), [[ST]]** [[CP0]] // CK22: call void [[CALL08:@.+]]([100 x [[ST]]]* {{[^,]+}}) #pragma omp target map(sc[1:4]) @@ -2940,10 +2998,10 @@ int explicit_maps_globals(void){ // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK22-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK22-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK22-DAG: [[CBPVAL0]] = bitcast [[ST]]* [[RVAR0:%.+]] to i8* - // CK22-DAG: [[CPVAL0]] = bitcast [[ST]]* [[SEC0:%.+]] to i8* + // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[ST]]** + // CK22-DAG: store [[ST]]* [[RVAR0:%.+]], [[ST]]** [[CBP0]] + // CK22-DAG: store [[ST]]* [[SEC0:%.+]], [[ST]]** [[CP0]] // CK22-DAG: [[RVAR0]] = load [[ST]]*, [[ST]]** @sd // CK22-DAG: [[SEC0]] = getelementptr {{.*}}[[ST]]* [[RVAR00:%.+]], i{{.+}} 2 // CK22-DAG: [[RVAR00]] = load [[ST]]*, [[ST]]** @sd @@ -2959,8 +3017,10 @@ int explicit_maps_globals(void){ // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK22-DAG: store i8* bitcast ([[STT]]* @sta to i8*), i8** [[BP0]] - // CK22-DAG: store i8* bitcast ([[STT]]* @sta to i8*), i8** [[P0]] + // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[STT]]** + // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[STT]]** + // CK22-DAG: store [[STT]]* @sta, [[STT]]** [[CBP0]] + // CK22-DAG: store [[STT]]* @sta, [[STT]]** [[CP0]] // CK22: call void [[CALL10:@.+]]([[STT]]* {{[^,]+}}) #pragma omp target map(sta) @@ -2973,8 +3033,10 @@ int explicit_maps_globals(void){ // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK22-DAG: store i8* bitcast ([100 x [[STT]]]* @stc to i8*), i8** [[BP0]] - // CK22-DAG: store i8* bitcast ([100 x [[STT]]]* @stc to i8*), i8** [[P0]] + // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x [[STT]]]** + // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [100 x [[STT]]]** + // CK22-DAG: store [100 x [[STT]]]* @stc, [100 x [[STT]]]** [[CBP0]] + // CK22-DAG: store [100 x [[STT]]]* @stc, [100 x [[STT]]]** [[CP0]] // CK22: call void [[CALL11:@.+]]([100 x [[STT]]]* {{[^,]+}}) #pragma omp target map(stc) @@ -2987,8 +3049,10 @@ int explicit_maps_globals(void){ // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK22-DAG: store i8* bitcast ([[STT]]** @std to i8*), i8** [[BP0]] - // CK22-DAG: store i8* bitcast ([[STT]]** @std to i8*), i8** [[P0]] + // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[STT]]*** + // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[STT]]*** + // CK22-DAG: store [[STT]]** @std, [[STT]]*** [[CBP0]] + // CK22-DAG: store [[STT]]** @std, [[STT]]*** [[CP0]] // CK22: call void [[CALL12:@.+]]([[STT]]** {{[^,]+}}) #pragma omp target map(std) @@ -3001,8 +3065,10 @@ int explicit_maps_globals(void){ // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK22-DAG: store i8* bitcast ([100 x [[STT]]]* @stc to i8*), i8** [[BP0]] - // CK22-DAG: store i8* bitcast ([[STT]]* getelementptr inbounds ([100 x [[STT]]], [100 x [[STT]]]* @stc, i{{.+}} 0, i{{.+}} 1) to i8*), i8** [[P0]] + // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x [[STT]]]** + // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[STT]]** + // CK22-DAG: store [100 x [[STT]]]* @stc, [100 x [[STT]]]** [[CBP0]] + // CK22-DAG: store [[STT]]* getelementptr inbounds ([100 x [[STT]]], [100 x [[STT]]]* @stc, i{{.+}} 0, i{{.+}} 1), [[STT]]** [[CP0]] // CK22: call void [[CALL13:@.+]]([100 x [[STT]]]* {{[^,]+}}) #pragma omp target map(stc[1:4]) @@ -3015,10 +3081,10 @@ int explicit_maps_globals(void){ // CK22-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK22-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK22-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK22-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK22-DAG: [[CBPVAL0]] = bitcast [[STT]]* [[RVAR0:%.+]] to i8* - // CK22-DAG: [[CPVAL0]] = bitcast [[STT]]* [[SEC0:%.+]] to i8* + // CK22-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[STT]]** + // CK22-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[STT]]** + // CK22-DAG: store [[STT]]* [[RVAR0:%.+]], [[STT]]** [[CBP0]] + // CK22-DAG: store [[STT]]* [[SEC0:%.+]], [[STT]]** [[CP0]] // CK22-DAG: [[RVAR0]] = load [[STT]]*, [[STT]]** @std // CK22-DAG: [[SEC0]] = getelementptr {{.*}}[[STT]]* [[RVAR00:%.+]], i{{.+}} 2 // CK22-DAG: [[RVAR00]] = load [[STT]]*, [[STT]]** @std @@ -3088,10 +3154,10 @@ int explicit_maps_inside_captured(int a){ // CK23-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK23-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK23-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK23-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK23-DAG: [[CBPVAL0]] = bitcast i32* [[VAR0:%.+]] to i8* - // CK23-DAG: [[CPVAL0]] = bitcast i32* [[VAR00:%.+]] to i8* + // CK23-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK23-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK23-DAG: store i32* [[VAR0:%.+]], i32** [[CBP0]] + // CK23-DAG: store i32* [[VAR00:%.+]], i32** [[CP0]] // CK23-DAG: [[VAR0]] = load i32*, i32** [[CAP0:%[^,]+]] // CK23-DAG: [[CAP0]] = getelementptr inbounds [[SA]], [[SA]] // CK23-DAG: [[VAR00]] = load i32*, i32** [[CAP00:%[^,]+]] @@ -3107,10 +3173,10 @@ int explicit_maps_inside_captured(int a){ // CK23-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK23-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK23-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK23-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK23-DAG: [[CBPVAL0]] = bitcast float* [[VAR0:%.+]] to i8* - // CK23-DAG: [[CPVAL0]] = bitcast float* [[VAR00:%.+]] to i8* + // CK23-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to float** + // CK23-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to float** + // CK23-DAG: store float* [[VAR0:%.+]], float** [[CBP0]] + // CK23-DAG: store float* [[VAR00:%.+]], float** [[CP0]] // CK23-DAG: [[VAR0]] = load float*, float** [[CAP0:%[^,]+]] // CK23-DAG: [[CAP0]] = getelementptr inbounds [[SA]], [[SA]] // CK23-DAG: [[VAR00]] = load float*, float** [[CAP00:%[^,]+]] @@ -3126,10 +3192,10 @@ int explicit_maps_inside_captured(int a){ // CK23-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK23-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK23-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK23-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK23-DAG: [[CBPVAL0]] = bitcast [100 x float]* [[VAR0:%.+]] to i8* - // CK23-DAG: [[CPVAL0]] = bitcast [100 x float]* [[VAR00:%.+]] to i8* + // CK23-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x float]** + // CK23-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [100 x float]** + // CK23-DAG: store [100 x float]* [[VAR0:%.+]], [100 x float]** [[CBP0]] + // CK23-DAG: store [100 x float]* [[VAR00:%.+]], [100 x float]** [[CP0]] // CK23-DAG: [[VAR0]] = load [100 x float]*, [100 x float]** [[CAP0:%[^,]+]] // CK23-DAG: [[CAP0]] = getelementptr inbounds [[SA]], [[SA]] // CK23-DAG: [[VAR00]] = load [100 x float]*, [100 x float]** [[CAP00:%[^,]+]] @@ -3146,10 +3212,10 @@ int explicit_maps_inside_captured(int a){ // CK23-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK23-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK23-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK23-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK23-DAG: [[CBPVAL0]] = bitcast float** [[VAR0:%.+]] to i8* - // CK23-DAG: [[CPVAL0]] = bitcast float** [[VAR00:%.+]] to i8* + // CK23-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to float*** + // CK23-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to float*** + // CK23-DAG: store float** [[VAR0:%.+]], float*** [[CBP0]] + // CK23-DAG: store float** [[VAR00:%.+]], float*** [[CP0]] // CK23-DAG: [[VAR0]] = load float**, float*** [[CAP0:%[^,]+]] // CK23-DAG: [[CAP0]] = getelementptr inbounds [[SA]], [[SA]] // CK23-DAG: [[VAR00]] = load float**, float*** [[CAP00:%[^,]+]] @@ -3165,10 +3231,10 @@ int explicit_maps_inside_captured(int a){ // CK23-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK23-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK23-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK23-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK23-DAG: [[CBPVAL0]] = bitcast [100 x float]* [[VAR0:%.+]] to i8* - // CK23-DAG: [[CPVAL0]] = bitcast float* [[SEC0:%.+]] to i8* + // CK23-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [100 x float]** + // CK23-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to float** + // CK23-DAG: store [100 x float]* [[VAR0:%.+]], [100 x float]** [[CBP0]] + // CK23-DAG: store float* [[SEC0:%.+]], float** [[CP0]] // CK23-DAG: [[SEC0]] = getelementptr {{.*}}[100 x float]* [[VAR00:%.+]], i{{.+}} 0, i{{.+}} 2 // CK23-DAG: [[VAR0]] = load [100 x float]*, [100 x float]** [[CAP0:%[^,]+]] // CK23-DAG: [[CAP0]] = getelementptr inbounds [[SA]], [[SA]] @@ -3186,10 +3252,10 @@ int explicit_maps_inside_captured(int a){ // CK23-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK23-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK23-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK23-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK23-DAG: [[CBPVAL0]] = bitcast float* [[RVAR0:%.+]] to i8* - // CK23-DAG: [[CPVAL0]] = bitcast float* [[SEC0:%.+]] to i8* + // CK23-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to float** + // CK23-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to float** + // CK23-DAG: store float* [[RVAR0:%.+]], float** [[CBP0]] + // CK23-DAG: store float* [[SEC0:%.+]], float** [[CP0]] // CK23-DAG: [[RVAR0]] = load float*, float** [[VAR0:%[^,]+]] // CK23-DAG: [[SEC0]] = getelementptr {{.*}}float* [[RVAR00:%.+]], i{{.+}} 2 // CK23-DAG: [[RVAR00]] = load float*, float** [[VAR00:%[^,]+]] @@ -3328,10 +3394,10 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SC]]* [[VAR0]], i{{.+}} 0, i{{.+}} 0 // CK24: call void [[CALL01:@.+]]([[SC]]* {{[^,]+}}) @@ -3345,10 +3411,10 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast [[SA]]* [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[SA]]** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store [[SA]]* [[SEC0:%.+]], [[SA]]** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SB]]* [[SEC00:%[^,]+]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[SEC00]] = getelementptr {{.*}}[[SC]]* [[VAR0]], i{{.+}} 0, i{{.+}} 1 @@ -3363,10 +3429,10 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SA]]* [[SEC00:%[^,]+]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[SEC00]] = getelementptr {{.*}}[[SB]]* [[SEC000:%[^,]+]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[SEC000]] = getelementptr {{.*}}[[SC]]* [[VAR0]], i{{.+}} 0, i{{.+}} 1 @@ -3382,10 +3448,10 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[10 x i32]* [[SEC00:%[^,]+]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[SEC00]] = getelementptr {{.*}}[[SC]]* [[VAR0]], i{{.+}} 0, i{{.+}} 3 @@ -3400,18 +3466,18 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast [[SB]]** [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[SB]]*** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store [[SB]]** [[SEC0:%.+]], [[SB]]*** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SC]]* [[VAR0]], i{{.+}} 0, i{{.+}} 2 // CK24-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 -// CK24-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] -// CK24-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] -// CK24-DAG: [[CBPVAL1]] = bitcast [[SB]]** [[SEC0]] to i8* -// CK24-DAG: [[CPVAL1]] = bitcast [[SB]]* [[SEC1:%.+]] to i8* +// CK24-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[SB]]*** +// CK24-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to [[SB]]** +// CK24-DAG: store [[SB]]** [[SEC0]], [[SB]]*** [[CBP1]] +// CK24-DAG: store [[SB]]* [[SEC1:%.+]], [[SB]]** [[CP1]] // CK24-DAG: [[SEC1]] = getelementptr {{.*}}[[SB]]* [[SEC11:%[^,]+]], i{{.+}} 0 // CK24-DAG: [[SEC11]] = load [[SB]]*, [[SB]]** [[SEC111:%[^,]+]], // CK24-DAG: [[SEC111]] = getelementptr {{.*}}[[SC]]* [[VAR0]], i{{.+}} 0, i{{.+}} 2 @@ -3427,10 +3493,10 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SA]]* [[SEC00:%[^,]+]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[SEC00]] = getelementptr {{.*}}[10 x [[SA]]]* [[SEC000:%[^,]+]], i{{.+}} 0, i{{.+}} 3 // CK24-DAG: [[SEC000]] = getelementptr {{.*}}[[SB]]* [[SEC0000:%[^,]+]], i{{.+}} 0, i{{.+}} 2 @@ -3447,20 +3513,20 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast [[SA]]** [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[SA]]*** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store [[SA]]** [[SEC0:%.+]], [[SA]]*** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[10 x [[SA]]*]* [[SEC00:%[^,]+]], i{{.+}} 0, i{{.+}} 3 // CK24-DAG: [[SEC00]] = getelementptr {{.*}}[[SB]]* [[SEC000:%[^,]+]], i{{.+}} 0, i{{.+}} 3 // CK24-DAG: [[SEC000]] = getelementptr {{.*}}[[SC]]* [[VAR0]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 -// CK24-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] -// CK24-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] -// CK24-DAG: [[CBPVAL1]] = bitcast [[SA]]** [[SEC0]] to i8* -// CK24-DAG: [[CPVAL1]] = bitcast i32* [[SEC1:%.+]] to i8* +// CK24-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[SA]]*** +// CK24-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** +// CK24-DAG: store [[SA]]** [[SEC0]], [[SA]]*** [[CBP1]] +// CK24-DAG: store i32* [[SEC1:%.+]], i32** [[CP1]] // CK24-DAG: [[SEC1]] = getelementptr {{.*}}[[SA]]* [[SEC11:%[^,]+]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[SEC11]] = load [[SA]]*, [[SA]]** [[SEC111:%[^,]+]], // CK24-DAG: [[SEC111]] = getelementptr {{.*}}[10 x [[SA]]*]* [[SEC1111:%[^,]+]], i{{.+}} 0, i{{.+}} 3 @@ -3478,18 +3544,18 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast [[SB]]** [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[SB]]*** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store [[SB]]** [[SEC0:%.+]], [[SB]]*** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SC]]* [[VAR0]], i{{.+}} 0, i{{.+}} 2 // CK24-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 -// CK24-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] -// CK24-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] -// CK24-DAG: [[CBPVAL1]] = bitcast [[SB]]** [[SEC0]] to i8* -// CK24-DAG: [[CPVAL1]] = bitcast i32* [[SEC1:%.+]] to i8* +// CK24-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[SB]]*** +// CK24-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** +// CK24-DAG: store [[SB]]** [[SEC0]], [[SB]]*** [[CBP1]] +// CK24-DAG: store i32* [[SEC1:%.+]], i32** [[CP1]] // CK24-DAG: [[SEC1]] = getelementptr {{.*}}[[SB]]* [[SEC11:%[^,]+]], i{{.+}} 0 // CK24-DAG: [[SEC11]] = load [[SB]]*, [[SB]]** [[SEC111:%[^,]+]], // CK24-DAG: [[SEC111]] = getelementptr {{.*}}[[SC]]* [[VAR0]], i{{.+}} 0, i{{.+}} 2 @@ -3505,19 +3571,19 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast [[SA]]** [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[SA]]*** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store [[SA]]** [[SEC0:%.+]], [[SA]]*** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SB]]* [[SEC00:[^,]+]], i{{.+}} 0, i{{.+}} 4 // CK24-DAG: [[SEC00]] = getelementptr {{.*}}[[SC]]* [[VAR0]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 -// CK24-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] -// CK24-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] -// CK24-DAG: [[CBPVAL1]] = bitcast [[SA]]** [[SEC0]] to i8* -// CK24-DAG: [[CPVAL1]] = bitcast i32* [[SEC1:%.+]] to i8* +// CK24-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[SA]]*** +// CK24-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** +// CK24-DAG: store [[SA]]** [[SEC0]], [[SA]]*** [[CBP1]] +// CK24-DAG: store i32* [[SEC1:%.+]], i32** [[CP1]] // CK24-DAG: [[SEC1]] = getelementptr {{.*}}[[SA]]* [[SEC11:%[^,]+]], i{{.+}} 0 // CK24-DAG: [[SEC11]] = load [[SA]]*, [[SA]]** [[SEC111:%[^,]+]], // CK24-DAG: [[SEC111]] = getelementptr {{.*}}[[SB]]* [[SEC1111:[^,]+]], i{{.+}} 0, i{{.+}} 4 @@ -3534,10 +3600,10 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[10 x i32]* [[SEC00:%[^,]+]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[SEC00]] = getelementptr {{.*}}[[SA]]* [[SEC000:%[^,]+]], i{{.+}} 0, i{{.+}} 2 // CK24-DAG: [[SEC000]] = getelementptr {{.*}}[[SB]]* [[SEC0000:%[^,]+]], i{{.+}} 0, i{{.+}} 1 @@ -3554,19 +3620,19 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast [[SA]]** [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[SA]]*** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store [[SA]]** [[SEC0:%.+]], [[SA]]*** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SB]]* [[SEC00:%[^,]+]], i{{.+}} 0, i{{.+}} 4 // CK24-DAG: [[SEC00]] = getelementptr {{.*}}[[SC]]* [[VAR0]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 -// CK24-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] -// CK24-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] -// CK24-DAG: [[CBPVAL1]] = bitcast [[SA]]** [[SEC0]] to i8* -// CK24-DAG: [[CPVAL1]] = bitcast i32* [[SEC1:%.+]] to i8* +// CK24-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[SA]]*** +// CK24-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** +// CK24-DAG: store [[SA]]** [[SEC0]], [[SA]]*** [[CBP1]] +// CK24-DAG: store i32* [[SEC1:%.+]], i32** [[CP1]] // CK24-DAG: [[SEC1]] = getelementptr {{.*}}[10 x i32]* [[SEC11:%[^,]+]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[SEC11]] = getelementptr {{.*}}[[SA]]* [[SEC111:%[^,]+]], i{{.+}} 0, i{{.+}} 2 // CK24-DAG: [[SEC111]] = load [[SA]]*, [[SA]]** [[SEC1111:%[^,]+]], @@ -3584,28 +3650,28 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast [[SB]]** [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[SB]]*** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store [[SB]]** [[SEC0:%.+]], [[SB]]*** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SC]]* [[VAR0]], i{{.+}} 0, i{{.+}} 2 // CK24-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 -// CK24-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] -// CK24-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] -// CK24-DAG: [[CBPVAL1]] = bitcast [[SB]]** [[SEC0]] to i8* -// CK24-DAG: [[CPVAL1]] = bitcast [[SA]]** [[SEC1:%.+]] to i8* +// CK24-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[SB]]*** +// CK24-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to [[SA]]*** +// CK24-DAG: store [[SB]]** [[SEC0:%.+]], [[SB]]*** [[CBP1]] +// CK24-DAG: store [[SA]]** [[SEC1:%.+]], [[SA]]*** [[CP1]] // CK24-DAG: [[SEC1]] = getelementptr {{.*}}[[SB]]* [[SEC11:%[^,]+]], i{{.+}} 0, i{{.+}} 4 // CK24-DAG: [[SEC11]] = load [[SB]]*, [[SB]]** [[SEC111:%[^,]+]], // CK24-DAG: [[SEC111]] = getelementptr {{.*}}[[SC]]* [[VAR0]], i{{.+}} 0, i{{.+}} 2 // CK24-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 2 // CK24-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 2 -// CK24-DAG: store i8* [[CBPVAL2:%[^,]+]], i8** [[BP2]] -// CK24-DAG: store i8* [[CPVAL2:%[^,]+]], i8** [[P2]] -// CK24-DAG: [[CBPVAL2]] = bitcast [[SA]]** [[SEC1]] to i8* -// CK24-DAG: [[CPVAL2]] = bitcast [[SA]]** [[SEC2:%.+]] to i8* +// CK24-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to [[SA]]*** +// CK24-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to [[SA]]*** +// CK24-DAG: store [[SA]]** [[SEC1:%.+]], [[SA]]*** [[CBP2]] +// CK24-DAG: store [[SA]]** [[SEC2:%.+]], [[SA]]*** [[CP2]] // CK24-DAG: [[SEC2]] = getelementptr {{.*}}[[SA]]* [[SEC22:%[^,]+]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[SEC22]] = load [[SA]]*, [[SA]]** [[SEC222:%[^,]+]], // CK24-DAG: [[SEC222]] = getelementptr {{.*}}[[SB]]* [[SEC2222:%[^,]+]], i{{.+}} 0, i{{.+}} 4 @@ -3614,10 +3680,10 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP3:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 3 // CK24-DAG: [[P3:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 3 -// CK24-DAG: store i8* [[CBPVAL3:%[^,]+]], i8** [[BP3]] -// CK24-DAG: store i8* [[CPVAL3:%[^,]+]], i8** [[P3]] -// CK24-DAG: [[CBPVAL3]] = bitcast [[SA]]** [[SEC2]] to i8* -// CK24-DAG: [[CPVAL3]] = bitcast i32* [[SEC3:%.+]] to i8* +// CK24-DAG: [[CBP3:%.+]] = bitcast i8** [[BP3]] to [[SA]]*** +// CK24-DAG: [[CP3:%.+]] = bitcast i8** [[P3]] to i32** +// CK24-DAG: store [[SA]]** [[SEC2]], [[SA]]*** [[CBP3]] +// CK24-DAG: store i32* [[SEC3:%.+]], i32** [[CP3]] // CK24-DAG: [[SEC3]] = getelementptr {{.*}}[[SA]]* [[SEC33:%[^,]+]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[SEC33]] = load [[SA]]*, [[SA]]** [[SEC333:%[^,]+]], // CK24-DAG: [[SEC333]] = getelementptr {{.*}}[[SA]]* [[SEC3333:%[^,]+]], i{{.+}} 0, i{{.+}} 1 @@ -3640,10 +3706,10 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SC]]* [[VAR00:%.+]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[VAR0]] = load [[SC]]*, [[SC]]** %{{.+}} @@ -3660,10 +3726,10 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast [[SA]]* [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[SA]]** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store [[SA]]* [[SEC0:%.+]], [[SA]]** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SB]]* [[SEC00:%[^,]+]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[SEC00]] = getelementptr {{.*}}[[SC]]* [[VAR00:%.+]], i{{.+}} 0, i{{.+}} 1 @@ -3681,10 +3747,10 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SA]]* [[SEC00:%[^,]+]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[SEC00]] = getelementptr {{.*}}[[SB]]* [[SEC000:%[^,]+]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[SEC000]] = getelementptr {{.*}}[[SC]]* [[VAR00:%.+]], i{{.+}} 0, i{{.+}} 1 @@ -3703,10 +3769,10 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[10 x i32]* [[SEC00:%[^,]+]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[SEC00]] = getelementptr {{.*}}[[SC]]* [[VAR00:%.+]], i{{.+}} 0, i{{.+}} 3 @@ -3724,18 +3790,18 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast [[SB]]** [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[SB]]*** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store [[SB]]** [[SEC0:%.+]], [[SB]]*** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SC]]* [[VAR00:%.+]], i{{.+}} 0, i{{.+}} 2 // CK24-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 -// CK24-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] -// CK24-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] -// CK24-DAG: [[CBPVAL1]] = bitcast [[SB]]** [[SEC0]] to i8* -// CK24-DAG: [[CPVAL1]] = bitcast [[SB]]* [[SEC1:%.+]] to i8* +// CK24-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[SB]]*** +// CK24-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to [[SB]]** +// CK24-DAG: store [[SB]]** [[SEC0]], [[SB]]*** [[CBP1]] +// CK24-DAG: store [[SB]]* [[SEC1:%.+]], [[SB]]** [[CP1]] // CK24-DAG: [[SEC1]] = getelementptr {{.*}}[[SB]]* [[SEC11:%[^,]+]], i{{.+}} 0 // CK24-DAG: [[SEC11]] = load [[SB]]*, [[SB]]** [[SEC111:%[^,]+]], // CK24-DAG: [[SEC111]] = getelementptr {{.*}}[[SC]]* [[VAR000:%.+]], i{{.+}} 0, i{{.+}} 2 @@ -3755,10 +3821,10 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SA]]* [[SEC00:%[^,]+]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[SEC00]] = getelementptr {{.*}}[10 x [[SA]]]* [[SEC000:%[^,]+]], i{{.+}} 0, i{{.+}} 3 // CK24-DAG: [[SEC000]] = getelementptr {{.*}}[[SB]]* [[SEC0000:%[^,]+]], i{{.+}} 0, i{{.+}} 2 @@ -3778,20 +3844,20 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast [[SA]]** [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[SA]]*** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store [[SA]]** [[SEC0:%.+]], [[SA]]*** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[10 x [[SA]]*]* [[SEC00:%[^,]+]], i{{.+}} 0, i{{.+}} 3 // CK24-DAG: [[SEC00]] = getelementptr {{.*}}[[SB]]* [[SEC000:%[^,]+]], i{{.+}} 0, i{{.+}} 3 // CK24-DAG: [[SEC000]] = getelementptr {{.*}}[[SC]]* [[VAR00:%.+]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 -// CK24-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] -// CK24-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] -// CK24-DAG: [[CBPVAL1]] = bitcast [[SA]]** [[SEC0]] to i8* -// CK24-DAG: [[CPVAL1]] = bitcast i32* [[SEC1:%.+]] to i8* +// CK24-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[SA]]*** +// CK24-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** +// CK24-DAG: store [[SA]]** [[SEC0]], [[SA]]*** [[CBP1]] +// CK24-DAG: store i32* [[SEC1:%.+]], i32** [[CP1]] // CK24-DAG: [[SEC1]] = getelementptr {{.*}}[[SA]]* [[SEC11:%[^,]+]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[SEC11]] = load [[SA]]*, [[SA]]** [[SEC111:%[^,]+]], // CK24-DAG: [[SEC111]] = getelementptr {{.*}}[10 x [[SA]]*]* [[SEC1111:%[^,]+]], i{{.+}} 0, i{{.+}} 3 @@ -3813,18 +3879,18 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast [[SB]]** [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[SB]]*** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store [[SB]]** [[SEC0:%.+]], [[SB]]*** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SC]]* [[VAR00:%.+]], i{{.+}} 0, i{{.+}} 2 // CK24-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 -// CK24-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] -// CK24-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] -// CK24-DAG: [[CBPVAL1]] = bitcast [[SB]]** [[SEC0]] to i8* -// CK24-DAG: [[CPVAL1]] = bitcast i32* [[SEC1:%.+]] to i8* +// CK24-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[SB]]*** +// CK24-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** +// CK24-DAG: store [[SB]]** [[SEC0]], [[SB]]*** [[CBP1]] +// CK24-DAG: store i32* [[SEC1:%.+]], i32** [[CP1]] // CK24-DAG: [[SEC1]] = getelementptr {{.*}}[[SB]]* [[SEC11:%[^,]+]], i{{.+}} 0 // CK24-DAG: [[SEC11]] = load [[SB]]*, [[SB]]** [[SEC111:%[^,]+]], // CK24-DAG: [[SEC111]] = getelementptr {{.*}}[[SC]]* [[VAR000:%.+]], i{{.+}} 0, i{{.+}} 2 @@ -3844,19 +3910,19 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast [[SA]]** [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[SA]]*** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store [[SA]]** [[SEC0:%.+]], [[SA]]*** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SB]]* [[SEC00:[^,]+]], i{{.+}} 0, i{{.+}} 4 // CK24-DAG: [[SEC00]] = getelementptr {{.*}}[[SC]]* [[VAR00:%.+]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 -// CK24-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] -// CK24-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] -// CK24-DAG: [[CBPVAL1]] = bitcast [[SA]]** [[SEC0]] to i8* -// CK24-DAG: [[CPVAL1]] = bitcast i32* [[SEC1:%.+]] to i8* +// CK24-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[SA]]*** +// CK24-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** +// CK24-DAG: store [[SA]]** [[SEC0]], [[SA]]*** [[CBP1]] +// CK24-DAG: store i32* [[SEC1:%.+]], i32** [[CP1]] // CK24-DAG: [[SEC1]] = getelementptr {{.*}}[[SA]]* [[SEC11:%[^,]+]], i{{.+}} 0 // CK24-DAG: [[SEC11]] = load [[SA]]*, [[SA]]** [[SEC111:%[^,]+]], // CK24-DAG: [[SEC111]] = getelementptr {{.*}}[[SB]]* [[SEC1111:[^,]+]], i{{.+}} 0, i{{.+}} 4 @@ -3877,10 +3943,10 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[10 x i32]* [[SEC00:%[^,]+]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[SEC00]] = getelementptr {{.*}}[[SA]]* [[SEC000:%[^,]+]], i{{.+}} 0, i{{.+}} 2 // CK24-DAG: [[SEC000]] = getelementptr {{.*}}[[SB]]* [[SEC0000:%[^,]+]], i{{.+}} 0, i{{.+}} 1 @@ -3900,19 +3966,19 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast [[SA]]** [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[SA]]*** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store [[SA]]** [[SEC0:%.+]], [[SA]]*** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SB]]* [[SEC00:%[^,]+]], i{{.+}} 0, i{{.+}} 4 // CK24-DAG: [[SEC00]] = getelementptr {{.*}}[[SC]]* [[VAR00:%.+]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 -// CK24-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] -// CK24-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] -// CK24-DAG: [[CBPVAL1]] = bitcast [[SA]]** [[SEC0]] to i8* -// CK24-DAG: [[CPVAL1]] = bitcast i32* [[SEC1:%.+]] to i8* +// CK24-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[SA]]*** +// CK24-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** +// CK24-DAG: store [[SA]]** [[SEC0]], [[SA]]*** [[CBP1]] +// CK24-DAG: store i32* [[SEC1:%.+]], i32** [[CP1]] // CK24-DAG: [[SEC1]] = getelementptr {{.*}}[10 x i32]* [[SEC11:%[^,]+]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[SEC11]] = getelementptr {{.*}}[[SA]]* [[SEC111:%[^,]+]], i{{.+}} 0, i{{.+}} 2 // CK24-DAG: [[SEC111]] = load [[SA]]*, [[SA]]** [[SEC1111:%[^,]+]], @@ -3934,28 +4000,28 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK24-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK24-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK24-DAG: [[CBPVAL0]] = bitcast [[SC]]* [[VAR0:%.+]] to i8* -// CK24-DAG: [[CPVAL0]] = bitcast [[SB]]** [[SEC0:%.+]] to i8* +// CK24-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SC]]** +// CK24-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[SB]]*** +// CK24-DAG: store [[SC]]* [[VAR0:%.+]], [[SC]]** [[CBP0]] +// CK24-DAG: store [[SB]]** [[SEC0:%.+]], [[SB]]*** [[CP0]] // CK24-DAG: [[SEC0]] = getelementptr {{.*}}[[SC]]* [[VAR00:%.+]], i{{.+}} 0, i{{.+}} 2 // CK24-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 -// CK24-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] -// CK24-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] -// CK24-DAG: [[CBPVAL1]] = bitcast [[SB]]** [[SEC0]] to i8* -// CK24-DAG: [[CPVAL1]] = bitcast [[SA]]** [[SEC1:%.+]] to i8* +// CK24-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[SB]]*** +// CK24-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to [[SA]]*** +// CK24-DAG: store [[SB]]** [[SEC0]], [[SB]]*** [[CBP1]] +// CK24-DAG: store [[SA]]** [[SEC1:%.+]], [[SA]]*** [[CP1]] // CK24-DAG: [[SEC1]] = getelementptr {{.*}}[[SB]]* [[SEC11:%[^,]+]], i{{.+}} 0, i{{.+}} 4 // CK24-DAG: [[SEC11]] = load [[SB]]*, [[SB]]** [[SEC111:%[^,]+]], // CK24-DAG: [[SEC111]] = getelementptr {{.*}}[[SC]]* [[VAR000:%.+]], i{{.+}} 0, i{{.+}} 2 // CK24-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 2 // CK24-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 2 -// CK24-DAG: store i8* [[CBPVAL2:%[^,]+]], i8** [[BP2]] -// CK24-DAG: store i8* [[CPVAL2:%[^,]+]], i8** [[P2]] -// CK24-DAG: [[CBPVAL2]] = bitcast [[SA]]** [[SEC1]] to i8* -// CK24-DAG: [[CPVAL2]] = bitcast [[SA]]** [[SEC2:%.+]] to i8* +// CK24-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to [[SA]]*** +// CK24-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to [[SA]]*** +// CK24-DAG: store [[SA]]** [[SEC1]], [[SA]]*** [[CBP2]] +// CK24-DAG: store [[SA]]** [[SEC2:%.+]], [[SA]]*** [[CP2]] // CK24-DAG: [[SEC2]] = getelementptr {{.*}}[[SA]]* [[SEC22:%[^,]+]], i{{.+}} 0, i{{.+}} 1 // CK24-DAG: [[SEC22]] = load [[SA]]*, [[SA]]** [[SEC222:%[^,]+]], // CK24-DAG: [[SEC222]] = getelementptr {{.*}}[[SB]]* [[SEC2222:%[^,]+]], i{{.+}} 0, i{{.+}} 4 @@ -3964,10 +4030,10 @@ int explicit_maps_struct_fields(int a){ // CK24-DAG: [[BP3:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 3 // CK24-DAG: [[P3:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 3 -// CK24-DAG: store i8* [[CBPVAL3:%[^,]+]], i8** [[BP3]] -// CK24-DAG: store i8* [[CPVAL3:%[^,]+]], i8** [[P3]] -// CK24-DAG: [[CBPVAL3]] = bitcast [[SA]]** [[SEC2]] to i8* -// CK24-DAG: [[CPVAL3]] = bitcast i32* [[SEC3:%.+]] to i8* +// CK24-DAG: [[CBP3:%.+]] = bitcast i8** [[BP3]] to [[SA]]*** +// CK24-DAG: [[CP3:%.+]] = bitcast i8** [[P3]] to i32** +// CK24-DAG: store [[SA]]** [[SEC2]], [[SA]]*** [[CBP3]] +// CK24-DAG: store i32* [[SEC3:%.+]], i32** [[CP3]] // CK24-DAG: [[SEC3]] = getelementptr {{.*}}[[SA]]* [[SEC33:%[^,]+]], i{{.+}} 0, i{{.+}} 0 // CK24-DAG: [[SEC33]] = load [[SA]]*, [[SA]]** [[SEC333:%[^,]+]], // CK24-DAG: [[SEC333]] = getelementptr {{.*}}[[SA]]* [[SEC3333:%[^,]+]], i{{.+}} 0, i{{.+}} 1 @@ -4047,10 +4113,10 @@ struct CC { // CK25-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK25-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK25-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK25-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK25-DAG: [[CBPVAL0]] = bitcast [[ST]]* [[VAR0:%.+]] to i8* - // CK25-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK25-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK25-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK25-DAG: store [[ST]]* [[VAR0:%.+]], [[ST]]** [[CBP0]] + // CK25-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK25-DAG: [[SEC0]] = getelementptr {{.*}}[[ST]]* [[VAR0:%.+]], i{{.+}} 0, i{{.+}} 0 // CK25: call void [[CALL00:@.+]]([[ST]]* {{[^,]+}}) @@ -4068,10 +4134,10 @@ struct CC { // CK25-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK25-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK25-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK25-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK25-DAG: [[CBPVAL0]] = bitcast i32* [[VAR0:%.+]] to i8* - // CK25-DAG: [[CPVAL0]] = bitcast i32* [[VAR0]] to i8* + // CK25-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK25-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK25-DAG: store i32* [[VAR0:%.+]], i32** [[CBP0]] + // CK25-DAG: store i32* [[VAR0]], i32** [[CP0]] // CK25: call void [[CALL01:@.+]](i32* {{[^,]+}}) #pragma omp target map(to:arg) @@ -4151,17 +4217,17 @@ struct CC { // CK26-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK26-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK26-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK26-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK26-DAG: [[CBPVAL0]] = bitcast [[ST]]* [[VAR0:%.+]] to i8* - // CK26-DAG: [[CPVAL0]] = bitcast [[ST]]* [[VAR0]] to i8* + // CK26-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK26-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[ST]]** + // CK26-DAG: store [[ST]]* [[VAR0:%.+]], [[ST]]** [[CBP0]] + // CK26-DAG: store [[ST]]* [[VAR0]], [[ST]]** [[CP0]] // CK26-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK26-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK26-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK26-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK26-DAG: [[CBPVAL1]] = bitcast i32* [[VAR1:%.+]] to i8* - // CK26-DAG: [[CPVAL1]] = bitcast i32* [[SEC1:%.+]] to i8* + // CK26-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32** + // CK26-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** + // CK26-DAG: store i32* [[VAR1:%.+]], i32** [[CBP1]] + // CK26-DAG: store i32* [[SEC1:%.+]], i32** [[CP1]] // CK26-DAG: [[VAR1]] = load i32*, i32** [[PVT:%.+]], // CK26-DAG: [[SEC1]] = load i32*, i32** [[PVT]], @@ -4178,17 +4244,17 @@ struct CC { // CK26-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK26-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK26-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK26-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK26-DAG: [[CBPVAL0]] = bitcast [[ST]]* [[VAR0:%.+]] to i8* - // CK26-DAG: [[CPVAL0]] = bitcast [[ST]]* [[VAR0]] to i8* + // CK26-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK26-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[ST]]** + // CK26-DAG: store [[ST]]* [[VAR0:%.+]], [[ST]]** [[CBP0]] + // CK26-DAG: store [[ST]]* [[VAR0]], [[ST]]** [[CP0]] // CK26-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK26-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK26-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK26-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK26-DAG: [[CBPVAL1]] = bitcast float* [[VAR1:%.+]] to i8* - // CK26-DAG: [[CPVAL1]] = bitcast float* [[SEC1:%.+]] to i8* + // CK26-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to float** + // CK26-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to float** + // CK26-DAG: store float* [[VAR1:%.+]], float** [[CBP1]] + // CK26-DAG: store float* [[SEC1:%.+]], float** [[CP1]] // CK26-DAG: [[VAR1]] = load float*, float** [[PVT:%.+]], // CK26-DAG: [[SEC1]] = load float*, float** [[PVT]], @@ -4205,17 +4271,17 @@ struct CC { // CK26-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK26-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK26-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK26-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK26-DAG: [[CBPVAL0]] = bitcast [[ST]]* [[VAR0:%.+]] to i8* - // CK26-DAG: [[CPVAL0]] = bitcast [[ST]]* [[VAR0]] to i8* + // CK26-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK26-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[ST]]** + // CK26-DAG: store [[ST]]* [[VAR0:%.+]], [[ST]]** [[CBP0]] + // CK26-DAG: store [[ST]]* [[VAR0]], [[ST]]** [[CP0]] // CK26-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK26-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK26-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK26-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK26-DAG: [[CBPVAL1]] = bitcast i32* [[VAR1:%.+]] to i8* - // CK26-DAG: [[CPVAL1]] = bitcast i32* [[SEC1:%.+]] to i8* + // CK26-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i32** + // CK26-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i32** + // CK26-DAG: store i32* [[VAR1:%.+]], i32** [[CBP1]] + // CK26-DAG: store i32* [[SEC1:%.+]], i32** [[CP1]] // CK26-DAG: [[VAR1]] = load i32*, i32** [[PVT:%.+]], // CK26-DAG: [[SEC1]] = load i32*, i32** [[PVT]], @@ -4232,17 +4298,17 @@ struct CC { // CK26-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK26-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK26-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK26-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK26-DAG: [[CBPVAL0]] = bitcast [[ST]]* [[VAR0:%.+]] to i8* - // CK26-DAG: [[CPVAL0]] = bitcast [[ST]]* [[VAR0]] to i8* + // CK26-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK26-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[ST]]** + // CK26-DAG: store [[ST]]* [[VAR0:%.+]], [[ST]]** [[CBP0]] + // CK26-DAG: store [[ST]]* [[VAR0]], [[ST]]** [[CP0]] // CK26-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK26-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK26-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK26-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK26-DAG: [[CBPVAL1]] = bitcast float* [[VAR1:%.+]] to i8* - // CK26-DAG: [[CPVAL1]] = bitcast float* [[SEC1:%.+]] to i8* + // CK26-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to float** + // CK26-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to float** + // CK26-DAG: store float* [[VAR1:%.+]], float** [[CBP1]] + // CK26-DAG: store float* [[SEC1:%.+]], float** [[CP1]] // CK26-DAG: [[VAR1]] = load float*, float** [[PVT:%.+]], // CK26-DAG: [[SEC1]] = load float*, float** [[PVT]], @@ -4335,10 +4401,10 @@ void zero_size_section_and_private_maps (int ii){ // CK27-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK27-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK27-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK27-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK27-DAG: [[CBPVAL0]] = bitcast i32* [[VAR0:%.+]] to i8* - // CK27-DAG: [[CPVAL0]] = bitcast i32* [[VAR0]] to i8* + // CK27-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK27-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK27-DAG: store i32* [[VAR0:%.+]], i32** [[CBP0]] + // CK27-DAG: store i32* [[VAR0]], i32** [[CP0]] // CK27: call void [[CALL00:@.+]](i32* {{[^,]+}}) #pragma omp target @@ -4353,10 +4419,10 @@ void zero_size_section_and_private_maps (int ii){ // CK27-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK27-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK27-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK27-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK27-DAG: [[CBPVAL0]] = bitcast i32* [[RVAR0:%.+]] to i8* - // CK27-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK27-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK27-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK27-DAG: store i32* [[RVAR0:%.+]], i32** [[CBP0]] + // CK27-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK27-DAG: [[RVAR0]] = load i32*, i32** [[VAR0:%[^,]+]] // CK27-DAG: [[SEC0]] = getelementptr {{.*}}i32* [[RVAR00:%.+]], i{{.+}} 0 // CK27-DAG: [[RVAR00]] = load i32*, i32** [[VAR0]] @@ -4374,10 +4440,10 @@ void zero_size_section_and_private_maps (int ii){ // CK27-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK27-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK27-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK27-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK27-DAG: [[CBPVAL0]] = bitcast i32* [[RVAR0:%.+]] to i8* - // CK27-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK27-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK27-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK27-DAG: store i32* [[RVAR0:%.+]], i32** [[CBP0]] + // CK27-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK27-DAG: [[RVAR0]] = load i32*, i32** [[VAR0:%[^,]+]] // CK27-DAG: [[SEC0]] = getelementptr {{.*}}i32* [[RVAR00:%.+]], i{{.+}} 0 // CK27-DAG: [[RVAR00]] = load i32*, i32** [[VAR0]] @@ -4395,10 +4461,10 @@ void zero_size_section_and_private_maps (int ii){ // CK27-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK27-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK27-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK27-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK27-DAG: [[CBPVAL0]] = bitcast i32* [[RVAR0:%.+]] to i8* - // CK27-DAG: [[CPVAL0]] = bitcast i32* [[SEC0:%.+]] to i8* + // CK27-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK27-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK27-DAG: store i32* [[RVAR0:%.+]], i32** [[CBP0]] + // CK27-DAG: store i32* [[SEC0:%.+]], i32** [[CP0]] // CK27-DAG: [[RVAR0]] = load i32*, i32** [[VAR0:%[^,]+]] // CK27-DAG: [[SEC0]] = getelementptr {{.*}}i32* [[RVAR00:%.+]], i{{.+}} %{{.+}} // CK27-DAG: [[RVAR00]] = load i32*, i32** [[VAR0]] @@ -4428,10 +4494,10 @@ void zero_size_section_and_private_maps (int ii){ // CK27-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK27-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK27-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK27-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK27-DAG: [[CBPVAL0]] = bitcast i32* [[VAR0:%.+]] to i8* - // CK27-DAG: [[CPVAL0]] = bitcast i32* [[VAR0]] to i8* + // CK27-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK27-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK27-DAG: store i32* [[VAR0:%.+]], i32** [[CBP0]] + // CK27-DAG: store i32* [[VAR0]], i32** [[CP0]] // CK27: call void [[CALL05:@.+]](i32* {{[^,]+}}) #pragma omp target firstprivate(pvtPtr) @@ -4453,10 +4519,10 @@ void zero_size_section_and_private_maps (int ii){ // CK27-DAG: [[PGEP]] = getelementptr inbounds {{.+}}[[PS:%[^,]+]], i32 0, i32 0 // CK27-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BPS]], i32 0, i32 0 // CK27-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[PS]], i32 0, i32 0 - // CK27-DAG: store i8* [[VALBP:%.+]], i8** [[BP1]], - // CK27-DAG: store i8* [[VALP:%.+]], i8** [[P1]], - // CK27-DAG: [[VALBP]] = inttoptr i[[Z]] [[VAL:%.+]] to i8* - // CK27-DAG: [[VALP]] = inttoptr i[[Z]] [[VAL:%.+]] to i8* + // CK27-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to i[[Z]]* + // CK27-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to i[[Z]]* + // CK27-DAG: store i[[Z]] [[VAL:%.+]], i[[Z]]* [[CBP1]] + // CK27-DAG: store i[[Z]] [[VAL]], i[[Z]]* [[CP1]] // CK27-DAG: [[VAL]] = load i[[Z]], i[[Z]]* [[ADDR:%.+]], // CK27-64-DAG: [[CADDR:%.+]] = bitcast i[[Z]]* [[ADDR]] to i32* // CK27-64-DAG: store i32 {{.+}}, i32* [[CADDR]], @@ -4482,10 +4548,10 @@ void zero_size_section_and_private_maps (int ii){ // CK27-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK27-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK27-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK27-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK27-DAG: [[CBPVAL0]] = bitcast [10 x i32]* [[VAR0:%.+]] to i8* - // CK27-DAG: [[CPVAL0]] = bitcast [10 x i32]* [[VAR0]] to i8* + // CK27-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [10 x i32]** + // CK27-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [10 x i32]** + // CK27-DAG: store [10 x i32]* [[VAR0:%.+]], [10 x i32]** [[CBP0]] + // CK27-DAG: store [10 x i32]* [[VAR0]], [10 x i32]** [[CP0]] // CK27: call void [[CALL09:@.+]]([10 x i32]* {{[^,]+}}) #pragma omp target firstprivate(pvtArr) @@ -4529,10 +4595,10 @@ void explicit_maps_pointer_references (int *p){ // CK28-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK28-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK28-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK28-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK28-DAG: [[CBPVAL0]] = bitcast i32** [[VAR0:%.+]] to i8* - // CK28-DAG: [[CPVAL0]] = bitcast i32** [[VAR1:%.+]] to i8* + // CK28-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32*** + // CK28-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32*** + // CK28-DAG: store i32** [[VAR0:%.+]], i32*** [[CBP0]] + // CK28-DAG: store i32** [[VAR1:%.+]], i32*** [[CP0]] // CK28-DAG: [[VAR0]] = load i32**, i32*** [[VAR00:%.+]], // CK28-DAG: [[VAR1]] = load i32**, i32*** [[VAR11:%.+]], @@ -4549,10 +4615,10 @@ void explicit_maps_pointer_references (int *p){ // CK28-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK28-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK28-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK28-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK28-DAG: [[CBPVAL0]] = bitcast i32* [[VAR0:%.+]] to i8* - // CK28-DAG: [[CPVAL0]] = bitcast i32* [[VAR1:%.+]] to i8* + // CK28-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK28-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK28-DAG: store i32* [[VAR0:%.+]], i32** [[CBP0]] + // CK28-DAG: store i32* [[VAR1:%.+]], i32** [[CP0]] // CK28-DAG: [[VAR0]] = load i32*, i32** [[VAR00:%.+]], // CK28-DAG: [[VAR00]] = load i32**, i32*** [[VAR000:%.+]], // CK28-DAG: [[VAR1]] = getelementptr inbounds i32, i32* [[VAR11:%.+]], i{{64|32}} 2 @@ -4609,36 +4675,36 @@ struct SSB{ // CK29-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK29-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK29-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK29-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK29-DAG: [[CBPVAL0]] = bitcast [[SSB]]* [[VAR0:%.+]] to i8* - // CK29-DAG: [[CPVAL0]] = bitcast [[SSA]]** [[VAR00:%.+]] to i8* + // CK29-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SSB]]** + // CK29-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[SSA]]** + // CK29-DAG: store [[SSB]]* [[VAR0:%.+]], [[SSB]]** [[CBP0]] + // CK29-DAG: store [[SSA]]** [[VAR00:%.+]], [[SSA]]*** [[CP0]] // CK29-DAG: [[VAR0]] = load [[SSB]]*, [[SSB]]** % // CK29-DAG: [[VAR00]] = getelementptr inbounds [[SSB]], [[SSB]]* [[VAR0]], i32 0, i32 0 // CK29-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK29-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK29-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK29-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK29-DAG: [[CBPVAL1]] = bitcast [[SSA]]** [[VAR00]] to i8* - // CK29-DAG: [[CPVAL1]] = bitcast double*** [[VAR1:%.+]] to i8* + // CK29-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[SSA]]*** + // CK29-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double**** + // CK29-DAG: store [[SSA]]** [[VAR00]], [[SSA]]*** [[CBP1]] + // CK29-DAG: store double*** [[VAR1:%.+]], double**** [[CP1]] // CK29-DAG: [[VAR1]] = getelementptr inbounds [[SSA]], [[SSA]]* %{{.+}}, i32 0, i32 1 // CK29-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 2 // CK29-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 2 - // CK29-DAG: store i8* [[CBPVAL2:%[^,]+]], i8** [[BP2]] - // CK29-DAG: store i8* [[CPVAL2:%[^,]+]], i8** [[P2]] - // CK29-DAG: [[CBPVAL2]] = bitcast double*** [[VAR1]] to i8* - // CK29-DAG: [[CPVAL2]] = bitcast double** [[VAR2:%.+]] to i8* + // CK29-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to double**** + // CK29-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to double*** + // CK29-DAG: store double*** [[VAR1]], double**** [[CBP2]] + // CK29-DAG: store double** [[VAR2:%.+]], double*** [[CP2]] // CK29-DAG: [[VAR2]] = load double**, double*** [[VAR22:%.+]], // CK29-DAG: [[VAR22]] = getelementptr inbounds [[SSA]], [[SSA]]* %{{.+}}, i32 0, i32 1 // CK29-DAG: [[BP3:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 3 // CK29-DAG: [[P3:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 3 - // CK29-DAG: store i8* [[CBPVAL3:%[^,]+]], i8** [[BP3]] - // CK29-DAG: store i8* [[CPVAL3:%[^,]+]], i8** [[P3]] - // CK29-DAG: [[CBPVAL3]] = bitcast double** [[VAR2]] to i8* - // CK29-DAG: [[CPVAL3]] = bitcast double* [[VAR3:%.+]] to i8* + // CK29-DAG: [[CBP3:%.+]] = bitcast i8** [[BP3]] to double*** + // CK29-DAG: [[CP3:%.+]] = bitcast i8** [[P3]] to double** + // CK29-DAG: store double** [[VAR2]], double*** [[CBP3]] + // CK29-DAG: store double* [[VAR3:%.+]], double** [[CP3]] // CK29-DAG: [[VAR3]] = getelementptr inbounds double, double* [[VAR33:%.+]], i{{.+}} 0 // CK29-DAG: [[VAR33]] = load double*, double** %{{.+}}, @@ -4656,34 +4722,34 @@ struct SSB{ // CK29-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK29-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK29-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK29-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK29-DAG: [[CBPVAL0]] = bitcast [[SSB]]* [[VAR0:%.+]] to i8* - // CK29-DAG: [[CPVAL0]] = bitcast [[SSA]]*** [[VAR00:%.+]] to i8* + // CK29-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SSB]]** + // CK29-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[SSA]]**** + // CK29-DAG: store [[SSB]]* [[VAR0:%.+]], [[SSB]]** [[CBP0]] + // CK29-DAG: store [[SSA]]*** [[VAR00:%.+]], [[SSA]]**** [[CP0]] // CK29-DAG: [[VAR00]] = getelementptr inbounds [[SSB]], [[SSB]]* [[VAR0]], i32 0, i32 1 // CK29-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK29-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK29-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK29-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK29-DAG: [[CBPVAL1]] = bitcast [[SSA]]*** [[VAR00]] to i8* - // CK29-DAG: [[CPVAL1]] = bitcast [[SSA]]** [[VAR1:%.+]] to i8* + // CK29-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[SSA]]**** + // CK29-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to [[SSA]]*** + // CK29-DAG: store [[SSA]]*** [[VAR00]], [[SSA]]**** [[CBP1]] + // CK29-DAG: store [[SSA]]** [[VAR1:%.+]], [[SSA]]*** [[CP1]] // CK29-DAG: [[VAR1]] = load [[SSA]]**, [[SSA]]*** [[VAR00]], // CK29-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 2 // CK29-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 2 - // CK29-DAG: store i8* [[CBPVAL2:%[^,]+]], i8** [[BP2]] - // CK29-DAG: store i8* [[CPVAL2:%[^,]+]], i8** [[P2]] - // CK29-DAG: [[CBPVAL2]] = bitcast [[SSA]]** [[VAR1]] to i8* - // CK29-DAG: [[CPVAL2]] = bitcast double** [[VAR2:%.+]] to i8* + // CK29-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to [[SSA]]*** + // CK29-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to double*** + // CK29-DAG: store [[SSA]]** [[VAR1]], [[SSA]]*** [[CBP2]] + // CK29-DAG: store double** [[VAR2:%.+]], double*** [[CP2]] // CK29-DAG: [[VAR2]] = getelementptr inbounds [[SSA]], [[SSA]]* %{{.+}}, i32 0, i32 0 // CK29-DAG: [[BP3:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 3 // CK29-DAG: [[P3:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 3 - // CK29-DAG: store i8* [[CBPVAL3:%[^,]+]], i8** [[BP3]] - // CK29-DAG: store i8* [[CPVAL3:%[^,]+]], i8** [[P3]] - // CK29-DAG: [[CBPVAL3]] = bitcast double** [[VAR2]] to i8* - // CK29-DAG: [[CPVAL3]] = bitcast double* [[VAR3:%.+]] to i8* + // CK29-DAG: [[CBP3:%.+]] = bitcast i8** [[BP3]] to double*** + // CK29-DAG: [[CP3:%.+]] = bitcast i8** [[P3]] to double** + // CK29-DAG: store double** [[VAR2]], double*** [[CBP3]] + // CK29-DAG: store double* [[VAR3:%.+]], double** [[CP3]] // CK29-DAG: [[VAR3]] = getelementptr inbounds double, double* [[VAR33:%.+]], i{{.+}} 0 // CK29-DAG: [[VAR33]] = load double*, double** %{{.+}}, @@ -4701,42 +4767,42 @@ struct SSB{ // CK29-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK29-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK29-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK29-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK29-DAG: [[CBPVAL0]] = bitcast [[SSB]]* [[VAR0:%.+]] to i8* - // CK29-DAG: [[CPVAL0]] = bitcast [[SSA]]*** [[VAR00:%.+]] to i8* + // CK29-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[SSB]]** + // CK29-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to [[SSA]]**** + // CK29-DAG: store [[SSB]]* [[VAR0:%.+]], [[SSB]]** [[CBP0]] + // CK29-DAG: store [[SSA]]*** [[VAR00:%.+]], [[SSA]]**** [[CP0]] // CK29-DAG: [[VAR00]] = getelementptr inbounds [[SSB]], [[SSB]]* [[VAR0]], i32 0, i32 1 // CK29-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK29-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK29-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] - // CK29-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK29-DAG: [[CBPVAL1]] = bitcast [[SSA]]*** [[VAR00]] to i8* - // CK29-DAG: [[CPVAL1]] = bitcast [[SSA]]** [[VAR1:%.+]] to i8* + // CK29-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to [[SSA]]**** + // CK29-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to [[SSA]]*** + // CK29-DAG: store [[SSA]]*** [[VAR00]], [[SSA]]**** [[CBP1]] + // CK29-DAG: store [[SSA]]** [[VAR1:%.+]], [[SSA]]*** [[CP1]] // CK29-DAG: [[VAR1]] = load [[SSA]]**, [[SSA]]*** [[VAR00]], // CK29-DAG: [[BP2:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 2 // CK29-DAG: [[P2:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 2 - // CK29-DAG: store i8* [[CBPVAL2:%[^,]+]], i8** [[BP2]] - // CK29-DAG: store i8* [[CPVAL2:%[^,]+]], i8** [[P2]] - // CK29-DAG: [[CBPVAL2]] = bitcast [[SSA]]** [[VAR1]] to i8* - // CK29-DAG: [[CPVAL2]] = bitcast double*** [[VAR2:%.+]] to i8* + // CK29-DAG: [[CBP2:%.+]] = bitcast i8** [[BP2]] to [[SSA]]*** + // CK29-DAG: [[CP2:%.+]] = bitcast i8** [[P2]] to double**** + // CK29-DAG: store [[SSA]]** [[VAR1]], [[SSA]]*** [[CBP2]] + // CK29-DAG: store double*** [[VAR2:%.+]], double**** [[CP2]] // CK29-DAG: [[VAR2]] = getelementptr inbounds [[SSA]], [[SSA]]* %{{.+}}, i32 0, i32 1 // CK29-DAG: [[BP3:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 3 // CK29-DAG: [[P3:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 3 - // CK29-DAG: store i8* [[CBPVAL3:%[^,]+]], i8** [[BP3]] - // CK29-DAG: store i8* [[CPVAL3:%[^,]+]], i8** [[P3]] - // CK29-DAG: [[CBPVAL3]] = bitcast double*** [[VAR2]] to i8* - // CK29-DAG: [[CPVAL3]] = bitcast double** [[VAR3:%.+]] to i8* + // CK29-DAG: [[CBP3:%.+]] = bitcast i8** [[BP3]] to double**** + // CK29-DAG: [[CP3:%.+]] = bitcast i8** [[P3]] to double*** + // CK29-DAG: store double*** [[VAR2]], double**** [[CBP3]] + // CK29-DAG: store double** [[VAR3:%.+]], double*** [[CP3]] // CK29-DAG: [[VAR3]] = load double**, double*** [[VAR2]], // CK29-DAG: [[BP4:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 4 // CK29-DAG: [[P4:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 4 - // CK29-DAG: store i8* [[CBPVAL4:%[^,]+]], i8** [[BP4]] - // CK29-DAG: store i8* [[CPVAL4:%[^,]+]], i8** [[P4]] - // CK29-DAG: [[CBPVAL4]] = bitcast double** [[VAR3]] to i8* - // CK29-DAG: [[CPVAL4]] = bitcast double* [[VAR4:%.+]] to i8* + // CK29-DAG: [[CBP4:%.+]] = bitcast i8** [[BP4]] to double*** + // CK29-DAG: [[CP4:%.+]] = bitcast i8** [[P4]] to double** + // CK29-DAG: store double** [[VAR3]], double*** [[CBP4]] + // CK29-DAG: store double* [[VAR4:%.+]], double** [[CP4]] // CK29-DAG: [[VAR4]] = getelementptr inbounds double, double* [[VAR44:%.+]], i{{.+}} 0 // CK29-DAG: [[VAR44]] = load double*, double** diff --git a/test/OpenMP/target_parallel_codegen.cpp b/test/OpenMP/target_parallel_codegen.cpp index 0801f631ee17..3063ab16abc8 100644 --- a/test/OpenMP/target_parallel_codegen.cpp +++ b/test/OpenMP/target_parallel_codegen.cpp @@ -121,10 +121,10 @@ int foo(int n) { // CHECK-DAG: [[P]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[PR:%[^,]+]], i32 0, i32 0 // CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[BPR]], i32 0, i32 [[IDX0:[0-9]+]] // CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[PR]], i32 0, i32 [[IDX0]] - // CHECK-DAG: store i8* [[BP0:%[^,]+]], i8** [[BPADDR0]] - // CHECK-DAG: store i8* [[P0:%[^,]+]], i8** [[PADDR0]] - // CHECK-DAG: [[BP0]] = inttoptr i[[SZ]] %{{.+}} to i8* - // CHECK-DAG: [[P0]] = inttoptr i[[SZ]] %{{.+}} to i8* + // CHECK-DAG: [[CBPADDR0:%.+]] = bitcast i8** [[BPADDR0]] to i[[SZ]]* + // CHECK-DAG: [[CPADDR0:%.+]] = bitcast i8** [[PADDR0]] to i[[SZ]]* + // CHECK-DAG: store i[[SZ]] [[VAL0:%.+]], i[[SZ]]* [[CBPADDR0]], + // CHECK-DAG: store i[[SZ]] [[VAL0]], i[[SZ]]* [[CPADDR0]], // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 // CHECK: [[RET2:%.+]] = load i32, i32* [[RHV]], align 4 @@ -148,17 +148,17 @@ int foo(int n) { // CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BP]], i32 0, i32 0 // CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[P]], i32 0, i32 0 - // CHECK-DAG: store i8* [[BP0:%[^,]+]], i8** [[BPADDR0]] - // CHECK-DAG: store i8* [[P0:%[^,]+]], i8** [[PADDR0]] - // CHECK-DAG: [[BP0]] = inttoptr i[[SZ]] %{{.+}} to i8* - // CHECK-DAG: [[P0]] = inttoptr i[[SZ]] %{{.+}} to i8* + // CHECK-DAG: [[CBPADDR0:%.+]] = bitcast i8** [[BPADDR0]] to i[[SZ]]* + // CHECK-DAG: [[CPADDR0:%.+]] = bitcast i8** [[PADDR0]] to i[[SZ]]* + // CHECK-DAG: store i[[SZ]] [[VAL0:%.+]], i[[SZ]]* [[CBPADDR0]], + // CHECK-DAG: store i[[SZ]] [[VAL0]], i[[SZ]]* [[CPADDR0]], // CHECK-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BP]], i32 0, i32 1 // CHECK-DAG: [[PADDR1:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[P]], i32 0, i32 1 - // CHECK-DAG: store i8* [[BP1:%[^,]+]], i8** [[BPADDR1]] - // CHECK-DAG: store i8* [[P1:%[^,]+]], i8** [[PADDR1]] - // CHECK-DAG: [[BP1]] = inttoptr i[[SZ]] %{{.+}} to i8* - // CHECK-DAG: [[P1]] = inttoptr i[[SZ]] %{{.+}} to i8* + // CHECK-DAG: [[CBPADDR1:%.+]] = bitcast i8** [[BPADDR1]] to i[[SZ]]* + // CHECK-DAG: [[CPADDR1:%.+]] = bitcast i8** [[PADDR1]] to i[[SZ]]* + // CHECK-DAG: store i[[SZ]] [[VAL1:%.+]], i[[SZ]]* [[CBPADDR1]], + // CHECK-DAG: store i[[SZ]] [[VAL1]], i[[SZ]]* [[CPADDR1]], // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 // CHECK-NEXT: br label %[[IFEND:.+]] @@ -232,56 +232,58 @@ int foo(int n) { // The names below are not necessarily consistent with the names used for the // addresses above as some are repeated. - // CHECK-DAG: [[BP0:%[^,]+]] = inttoptr i[[SZ]] [[VLA0]] to i8* - // CHECK-DAG: [[P0:%[^,]+]] = inttoptr i[[SZ]] [[VLA0]] to i8* - // CHECK-DAG: store i8* [[BP0]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P0]], i8** {{%[^,]+}} + // CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CBPADDR0:%.+]], + // CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CPADDR0:%.+]], + // CHECK-DAG: [[CBPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* + // CHECK-DAG: [[CPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* {{%[^,]+}} - // CHECK-DAG: [[BP1:%[^,]+]] = inttoptr i[[SZ]] [[VLA1]] to i8* - // CHECK-DAG: [[P1:%[^,]+]] = inttoptr i[[SZ]] [[VLA1]] to i8* - // CHECK-DAG: store i8* [[BP1]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P1]], i8** {{%[^,]+}} + // CHECK-DAG: store i[[SZ]] [[VLA1]], i[[SZ]]* [[CBPADDR1:%.+]], + // CHECK-DAG: store i[[SZ]] [[VLA1]], i[[SZ]]* [[CPADDR1:%.+]], + // CHECK-DAG: [[CBPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* + // CHECK-DAG: [[CPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* {{%[^,]+}} - // CHECK-DAG: store i8* inttoptr (i[[SZ]] 5 to i8*), i8** {{%[^,]+}} - // CHECK-DAG: store i8* inttoptr (i[[SZ]] 5 to i8*), i8** {{%[^,]+}} + // CHECK-DAG: store i[[SZ]] 5, i[[SZ]]* [[CBPADDR2:%.+]], + // CHECK-DAG: store i[[SZ]] 5, i[[SZ]]* [[CPADDR2:%.+]], + // CHECK-DAG: [[CBPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* + // CHECK-DAG: [[CPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* {{%[^,]+}} - // CHECK-DAG: [[BP3:%[^,]+]] = inttoptr i[[SZ]] [[A_CVAL]] to i8* - // CHECK-DAG: [[P3:%[^,]+]] = inttoptr i[[SZ]] [[A_CVAL]] to i8* - // CHECK-DAG: store i8* [[BP3]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P3]], i8** {{%[^,]+}} + // CHECK-DAG: store i[[SZ]] [[A_CVAL]], i[[SZ]]* [[CBPADDR3:%.+]], + // CHECK-DAG: store i[[SZ]] [[A_CVAL]], i[[SZ]]* [[CPADDR3:%.+]], + // CHECK-DAG: [[CBPADDR3]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* + // CHECK-DAG: [[CPADDR3]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: store i[[SZ]] 4, i[[SZ]]* {{%[^,]+}} - // CHECK-DAG: [[BP4:%[^,]+]] = bitcast [10 x float]* %{{.+}} to i8* - // CHECK-DAG: [[P4:%[^,]+]] = bitcast [10 x float]* %{{.+}} to i8* - // CHECK-DAG: store i8* [[BP4]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P4]], i8** {{%[^,]+}} + // CHECK-DAG: store [10 x float]* %{{.+}}, [10 x float]** [[CBPADDR4:%.+]], + // CHECK-DAG: store [10 x float]* %{{.+}}, [10 x float]** [[CPADDR4:%.+]], + // CHECK-DAG: [[CBPADDR4]] = bitcast i8** {{%[^,]+}} to [10 x float]** + // CHECK-DAG: [[CPADDR4]] = bitcast i8** {{%[^,]+}} to [10 x float]** // CHECK-DAG: store i[[SZ]] 40, i[[SZ]]* {{%[^,]+}} - // CHECK-DAG: [[BP5:%[^,]+]] = bitcast float* %{{.+}} to i8* - // CHECK-DAG: [[P5:%[^,]+]] = bitcast float* %{{.+}} to i8* - // CHECK-DAG: store i8* [[BP5]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P5]], i8** {{%[^,]+}} + // CHECK-DAG: store float* %{{.+}}, float** [[CBPADDR5:%.+]], + // CHECK-DAG: store float* %{{.+}}, float** [[CPADDR5:%.+]], + // CHECK-DAG: [[CBPADDR5]] = bitcast i8** {{%[^,]+}} to float** + // CHECK-DAG: [[CPADDR5]] = bitcast i8** {{%[^,]+}} to float** // CHECK-DAG: store i[[SZ]] [[BNSIZE]], i[[SZ]]* {{%[^,]+}} - // CHECK-DAG: [[BP6:%[^,]+]] = bitcast [5 x [10 x double]]* %{{.+}} to i8* - // CHECK-DAG: [[P6:%[^,]+]] = bitcast [5 x [10 x double]]* %{{.+}} to i8* - // CHECK-DAG: store i8* [[BP6]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P6]], i8** {{%[^,]+}} + // CHECK-DAG: store [5 x [10 x double]]* %{{.+}}, [5 x [10 x double]]** [[CBPADDR6:%.+]], + // CHECK-DAG: store [5 x [10 x double]]* %{{.+}}, [5 x [10 x double]]** [[CPADDR6:%.+]], + // CHECK-DAG: [[CBPADDR6]] = bitcast i8** {{%[^,]+}} to [5 x [10 x double]]** + // CHECK-DAG: [[CPADDR6]] = bitcast i8** {{%[^,]+}} to [5 x [10 x double]]** // CHECK-DAG: store i[[SZ]] 400, i[[SZ]]* {{%[^,]+}} - // CHECK-DAG: [[BP7:%[^,]+]] = bitcast double* %{{.+}} to i8* - // CHECK-DAG: [[P7:%[^,]+]] = bitcast double* %{{.+}} to i8* - // CHECK-DAG: store i8* [[BP7]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P7]], i8** {{%[^,]+}} + // CHECK-DAG: store double* %{{.+}}, double** [[CBPADDR7:%.+]], + // CHECK-DAG: store double* %{{.+}}, double** [[CPADDR7:%.+]], + // CHECK-DAG: [[CBPADDR7]] = bitcast i8** {{%[^,]+}} to double** + // CHECK-DAG: [[CPADDR7]] = bitcast i8** {{%[^,]+}} to double** // CHECK-DAG: store i[[SZ]] [[CNSIZE]], i[[SZ]]* {{%[^,]+}} - // CHECK-DAG: [[BP8:%[^,]+]] = bitcast [[TT]]* %{{.+}} to i8* - // CHECK-DAG: [[P8:%[^,]+]] = bitcast [[TT]]* %{{.+}} to i8* - // CHECK-DAG: store i8* [[BP8]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P8]], i8** {{%[^,]+}} + // CHECK-DAG: store [[TT]]* %{{.+}}, [[TT]]** [[CBPADDR8:%.+]], + // CHECK-DAG: store [[TT]]* %{{.+}}, [[TT]]** [[CPADDR8:%.+]], + // CHECK-DAG: [[CBPADDR8]] = bitcast i8** {{%[^,]+}} to [[TT]]** + // CHECK-DAG: [[CPADDR8]] = bitcast i8** {{%[^,]+}} to [[TT]]** // CHECK-DAG: store i[[SZ]] {{12|16}}, i[[SZ]]* {{%[^,]+}} // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 @@ -550,32 +552,34 @@ int bar(int n){ // The names below are not necessarily consistent with the names used for the // addresses above as some are repeated. -// CHECK-DAG: [[BP0:%[^,]+]] = inttoptr i[[SZ]] [[VLA0]] to i8* -// CHECK-DAG: [[P0:%[^,]+]] = inttoptr i[[SZ]] [[VLA0]] to i8* -// CHECK-DAG: store i8* [[BP0]], i8** {{%[^,]+}} -// CHECK-DAG: store i8* [[P0]], i8** {{%[^,]+}} +// CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CBPADDR0:%.+]], +// CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CPADDR0:%.+]], +// CHECK-DAG: [[CBPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* +// CHECK-DAG: [[CPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* {{%[^,]+}} -// CHECK-DAG: store i8* inttoptr (i[[SZ]] 2 to i8*), i8** {{%[^,]+}} -// CHECK-DAG: store i8* inttoptr (i[[SZ]] 2 to i8*), i8** {{%[^,]+}} +// CHECK-DAG: store i[[SZ]] 2, i[[SZ]]* [[CBPADDR1:%.+]], +// CHECK-DAG: store i[[SZ]] 2, i[[SZ]]* [[CPADDR1:%.+]], +// CHECK-DAG: [[CBPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* +// CHECK-DAG: [[CPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* {{%[^,]+}} -// CHECK-DAG: [[BP2:%[^,]+]] = inttoptr i[[SZ]] [[B_CVAL]] to i8* -// CHECK-DAG: [[P2:%[^,]+]] = inttoptr i[[SZ]] [[B_CVAL]] to i8* -// CHECK-DAG: store i8* [[BP2]], i8** {{%[^,]+}} -// CHECK-DAG: store i8* [[P2]], i8** {{%[^,]+}} +// CHECK-DAG: store i[[SZ]] [[B_CVAL]], i[[SZ]]* [[CBPADDR2:%.+]], +// CHECK-DAG: store i[[SZ]] [[B_CVAL]], i[[SZ]]* [[CPADDR2:%.+]], +// CHECK-DAG: [[CBPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* +// CHECK-DAG: [[CPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: store i[[SZ]] 4, i[[SZ]]* {{%[^,]+}} -// CHECK-DAG: [[BP3:%[^,]+]] = bitcast [[S1]]* %{{.+}} to i8* -// CHECK-DAG: [[P3:%[^,]+]] = bitcast [[S1]]* %{{.+}} to i8* -// CHECK-DAG: store i8* [[BP3]], i8** {{%[^,]+}} -// CHECK-DAG: store i8* [[P3]], i8** {{%[^,]+}} +// CHECK-DAG: store [[S1]]* %{{.+}}, [[S1]]** [[CBPADDR3:%.+]], +// CHECK-DAG: store [[S1]]* %{{.+}}, [[S1]]** [[CPADDR3:%.+]], +// CHECK-DAG: [[CBPADDR3]] = bitcast i8** {{%[^,]+}} to [[S1]]** +// CHECK-DAG: [[CPADDR3]] = bitcast i8** {{%[^,]+}} to [[S1]]** // CHECK-DAG: store i[[SZ]] 8, i[[SZ]]* {{%[^,]+}} -// CHECK-DAG: [[BP4:%[^,]+]] = bitcast i16* %{{.+}} to i8* -// CHECK-DAG: [[P4:%[^,]+]] = bitcast i16* %{{.+}} to i8* -// CHECK-DAG: store i8* [[BP4]], i8** {{%[^,]+}} -// CHECK-DAG: store i8* [[P4]], i8** {{%[^,]+}} +// CHECK-DAG: store i16* %{{.+}}, i16** [[CBPADDR4:%.+]], +// CHECK-DAG: store i16* %{{.+}}, i16** [[CPADDR4:%.+]], +// CHECK-DAG: [[CBPADDR4]] = bitcast i8** {{%[^,]+}} to i16** +// CHECK-DAG: [[CPADDR4]] = bitcast i8** {{%[^,]+}} to i16** // CHECK-DAG: store i[[SZ]] [[CSIZE]], i[[SZ]]* {{%[^,]+}} // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 @@ -600,29 +604,31 @@ int bar(int n){ // CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[BP]], i32 0, i32 0 // CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[P]], i32 0, i32 0 -// CHECK-DAG: store i8* [[BP0:%[^,]+]], i8** [[BPADDR0]] -// CHECK-DAG: store i8* [[P0:%[^,]+]], i8** [[PADDR0]] -// CHECK-DAG: [[BP0]] = inttoptr i[[SZ]] [[VAL0:%.+]] to i8* -// CHECK-DAG: [[P0]] = inttoptr i[[SZ]] [[VAL0]] to i8* +// CHECK-DAG: [[CBPADDR0:%.+]] = bitcast i8** [[BPADDR0]] to i[[SZ]]* +// CHECK-DAG: [[CPADDR0:%.+]] = bitcast i8** [[PADDR0]] to i[[SZ]]* +// CHECK-DAG: store i[[SZ]] [[VAL0:%.+]], i[[SZ]]* [[CBPADDR0]], +// CHECK-DAG: store i[[SZ]] [[VAL0]], i[[SZ]]* [[CPADDR0]], // CHECK-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[BP]], i32 0, i32 1 // CHECK-DAG: [[PADDR1:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[P]], i32 0, i32 1 -// CHECK-DAG: store i8* [[BP1:%[^,]+]], i8** [[BPADDR1]] -// CHECK-DAG: store i8* [[P1:%[^,]+]], i8** [[PADDR1]] -// CHECK-DAG: [[BP1]] = inttoptr i[[SZ]] [[VAL1:%.+]] to i8* -// CHECK-DAG: [[P1]] = inttoptr i[[SZ]] [[VAL1]] to i8* +// CHECK-DAG: [[CBPADDR1:%.+]] = bitcast i8** [[BPADDR1]] to i[[SZ]]* +// CHECK-DAG: [[CPADDR1:%.+]] = bitcast i8** [[PADDR1]] to i[[SZ]]* +// CHECK-DAG: store i[[SZ]] [[VAL1:%.+]], i[[SZ]]* [[CBPADDR1]], +// CHECK-DAG: store i[[SZ]] [[VAL1]], i[[SZ]]* [[CPADDR1]], // CHECK-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[BP]], i32 0, i32 2 // CHECK-DAG: [[PADDR2:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[P]], i32 0, i32 2 -// CHECK-DAG: store i8* [[BP2:%[^,]+]], i8** [[BPADDR2]] -// CHECK-DAG: store i8* [[P2:%[^,]+]], i8** [[PADDR2]] +// CHECK-DAG: [[CBPADDR2:%.+]] = bitcast i8** [[BPADDR2]] to i[[SZ]]* +// CHECK-DAG: [[CPADDR2:%.+]] = bitcast i8** [[PADDR2]] to i[[SZ]]* +// CHECK-DAG: store i[[SZ]] [[VAL2:%.+]], i[[SZ]]* [[CBPADDR2]], +// CHECK-DAG: store i[[SZ]] [[VAL2]], i[[SZ]]* [[CPADDR2]], // CHECK-DAG: [[BPADDR3:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[BP]], i32 0, i32 3 // CHECK-DAG: [[PADDR3:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[P]], i32 0, i32 3 -// CHECK-DAG: store i8* [[BP3:%[^,]+]], i8** [[BPADDR3]] -// CHECK-DAG: store i8* [[P3:%[^,]+]], i8** [[PADDR3]] -// CHECK-DAG: [[BP3]] = bitcast [10 x i32]* %{{.+}} to i8* -// CHECK-DAG: [[P3]] = bitcast [10 x i32]* %{{.+}} to i8* +// CHECK-DAG: [[CBPADDR3:%.+]] = bitcast i8** [[BPADDR3]] to [10 x i32]** +// CHECK-DAG: [[CPADDR3:%.+]] = bitcast i8** [[PADDR3]] to [10 x i32]** +// CHECK-DAG: store [10 x i32]* [[VAL3:%.+]], [10 x i32]** [[CBPADDR3]], +// CHECK-DAG: store [10 x i32]* [[VAL3]], [10 x i32]** [[CPADDR3]], // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 // CHECK-NEXT: br label %[[IFEND:.+]] @@ -652,24 +658,24 @@ int bar(int n){ // CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BP]], i32 0, i32 0 // CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[P]], i32 0, i32 0 -// CHECK-DAG: store i8* [[BP0:%[^,]+]], i8** [[BPADDR0]] -// CHECK-DAG: store i8* [[P0:%[^,]+]], i8** [[PADDR0]] -// CHECK-DAG: [[BP0]] = inttoptr i[[SZ]] [[VAL0:%.+]] to i8* -// CHECK-DAG: [[P0]] = inttoptr i[[SZ]] [[VAL0]] to i8* +// CHECK-DAG: [[CBPADDR0:%.+]] = bitcast i8** [[BPADDR0]] to i[[SZ]]* +// CHECK-DAG: [[CPADDR0:%.+]] = bitcast i8** [[PADDR0]] to i[[SZ]]* +// CHECK-DAG: store i[[SZ]] [[VAL0:%.+]], i[[SZ]]* [[CBPADDR0]], +// CHECK-DAG: store i[[SZ]] [[VAL0]], i[[SZ]]* [[CPADDR0]], // CHECK-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BP]], i32 0, i32 1 // CHECK-DAG: [[PADDR1:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[P]], i32 0, i32 1 -// CHECK-DAG: store i8* [[BP1:%[^,]+]], i8** [[BPADDR1]] -// CHECK-DAG: store i8* [[P1:%[^,]+]], i8** [[PADDR1]] -// CHECK-DAG: [[BP1]] = inttoptr i[[SZ]] [[VAL1:%.+]] to i8* -// CHECK-DAG: [[P1]] = inttoptr i[[SZ]] [[VAL1]] to i8* +// CHECK-DAG: [[CBPADDR1:%.+]] = bitcast i8** [[BPADDR1]] to i[[SZ]]* +// CHECK-DAG: [[CPADDR1:%.+]] = bitcast i8** [[PADDR1]] to i[[SZ]]* +// CHECK-DAG: store i[[SZ]] [[VAL1:%.+]], i[[SZ]]* [[CBPADDR1]], +// CHECK-DAG: store i[[SZ]] [[VAL1]], i[[SZ]]* [[CPADDR1]], // CHECK-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BP]], i32 0, i32 2 // CHECK-DAG: [[PADDR2:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[P]], i32 0, i32 2 -// CHECK-DAG: store i8* [[BP2:%[^,]+]], i8** [[BPADDR2]] -// CHECK-DAG: store i8* [[P2:%[^,]+]], i8** [[PADDR2]] -// CHECK-DAG: [[BP2]] = bitcast [10 x i32]* %{{.+}} to i8* -// CHECK-DAG: [[P2]] = bitcast [10 x i32]* %{{.+}} to i8* +// CHECK-DAG: [[CBPADDR2:%.+]] = bitcast i8** [[BPADDR2]] to [10 x i32]** +// CHECK-DAG: [[CPADDR2:%.+]] = bitcast i8** [[PADDR2]] to [10 x i32]** +// CHECK-DAG: store [10 x i32]* [[VAL2:%.+]], [10 x i32]** [[CBPADDR2]], +// CHECK-DAG: store [10 x i32]* [[VAL2]], [10 x i32]** [[CPADDR2]], // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 // CHECK-NEXT: br label %[[IFEND:.+]] diff --git a/test/OpenMP/target_teams_codegen.cpp b/test/OpenMP/target_teams_codegen.cpp index 4b08a6015afe..208cda6bb350 100644 --- a/test/OpenMP/target_teams_codegen.cpp +++ b/test/OpenMP/target_teams_codegen.cpp @@ -121,10 +121,10 @@ int foo(int n) { // CHECK-DAG: [[P]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[PR:%[^,]+]], i32 0, i32 0 // CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[BPR]], i32 0, i32 [[IDX0:[0-9]+]] // CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[PR]], i32 0, i32 [[IDX0]] - // CHECK-DAG: store i8* [[BP0:%[^,]+]], i8** [[BPADDR0]] - // CHECK-DAG: store i8* [[P0:%[^,]+]], i8** [[PADDR0]] - // CHECK-DAG: [[BP0]] = inttoptr i[[SZ]] %{{.+}} to i8* - // CHECK-DAG: [[P0]] = inttoptr i[[SZ]] %{{.+}} to i8* + // CHECK-DAG: [[CBPADDR0:%.+]] = bitcast i8** [[BPADDR0]] to i[[SZ]]* + // CHECK-DAG: [[CPADDR0:%.+]] = bitcast i8** [[PADDR0]] to i[[SZ]]* + // CHECK-DAG: store i[[SZ]] %{{.+}}, i[[SZ]]* [[CBPADDR0]] + // CHECK-DAG: store i[[SZ]] %{{.+}}, i[[SZ]]* [[CPADDR0]] // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 // CHECK: [[RET2:%.+]] = load i32, i32* [[RHV]], align 4 @@ -148,17 +148,17 @@ int foo(int n) { // CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BP]], i32 0, i32 0 // CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[P]], i32 0, i32 0 - // CHECK-DAG: store i8* [[BP0:%[^,]+]], i8** [[BPADDR0]] - // CHECK-DAG: store i8* [[P0:%[^,]+]], i8** [[PADDR0]] - // CHECK-DAG: [[BP0]] = inttoptr i[[SZ]] %{{.+}} to i8* - // CHECK-DAG: [[P0]] = inttoptr i[[SZ]] %{{.+}} to i8* + // CHECK-DAG: [[CBPADDR0:%.+]] = bitcast i8** [[BPADDR0]] to i[[SZ]]* + // CHECK-DAG: [[CPADDR0:%.+]] = bitcast i8** [[PADDR0]] to i[[SZ]]* + // CHECK-DAG: store i[[SZ]] %{{.+}}, i[[SZ]]* [[CBPADDR0]] + // CHECK-DAG: store i[[SZ]] %{{.+}}, i[[SZ]]* [[CPADDR0]] // CHECK-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[BP]], i32 0, i32 1 // CHECK-DAG: [[PADDR1:%.+]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[P]], i32 0, i32 1 - // CHECK-DAG: store i8* [[BP1:%[^,]+]], i8** [[BPADDR1]] - // CHECK-DAG: store i8* [[P1:%[^,]+]], i8** [[PADDR1]] - // CHECK-DAG: [[BP1]] = inttoptr i[[SZ]] %{{.+}} to i8* - // CHECK-DAG: [[P1]] = inttoptr i[[SZ]] %{{.+}} to i8* + // CHECK-DAG: [[CBPADDR1:%.+]] = bitcast i8** [[BPADDR1]] to i[[SZ]]* + // CHECK-DAG: [[CPADDR1:%.+]] = bitcast i8** [[PADDR1]] to i[[SZ]]* + // CHECK-DAG: store i[[SZ]] %{{.+}}, i[[SZ]]* [[CBPADDR1]] + // CHECK-DAG: store i[[SZ]] %{{.+}}, i[[SZ]]* [[CPADDR1]] // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 // CHECK-NEXT: br label %[[IFEND:.+]] @@ -232,56 +232,58 @@ int foo(int n) { // The names below are not necessarily consistent with the names used for the // addresses above as some are repeated. - // CHECK-DAG: [[BP0:%[^,]+]] = inttoptr i[[SZ]] [[VLA0]] to i8* - // CHECK-DAG: [[P0:%[^,]+]] = inttoptr i[[SZ]] [[VLA0]] to i8* - // CHECK-DAG: store i8* [[BP0]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P0]], i8** {{%[^,]+}} + // CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CBPADDR0:%.+]], + // CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CPADDR0:%.+]], + // CHECK-DAG: [[CBPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* + // CHECK-DAG: [[CPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* {{%[^,]+}} - // CHECK-DAG: [[BP1:%[^,]+]] = inttoptr i[[SZ]] [[VLA1]] to i8* - // CHECK-DAG: [[P1:%[^,]+]] = inttoptr i[[SZ]] [[VLA1]] to i8* - // CHECK-DAG: store i8* [[BP1]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P1]], i8** {{%[^,]+}} + // CHECK-DAG: store i[[SZ]] [[VLA1]], i[[SZ]]* [[CBPADDR1:%.+]], + // CHECK-DAG: store i[[SZ]] [[VLA1]], i[[SZ]]* [[CPADDR1:%.+]], + // CHECK-DAG: [[CBPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* + // CHECK-DAG: [[CPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* {{%[^,]+}} - // CHECK-DAG: store i8* inttoptr (i[[SZ]] 5 to i8*), i8** {{%[^,]+}} - // CHECK-DAG: store i8* inttoptr (i[[SZ]] 5 to i8*), i8** {{%[^,]+}} + // CHECK-DAG: store i[[SZ]] 5, i[[SZ]]* [[CBPADDR2:%.+]], + // CHECK-DAG: store i[[SZ]] 5, i[[SZ]]* [[CPADDR2:%.+]], + // CHECK-DAG: [[CBPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* + // CHECK-DAG: [[CPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* {{%[^,]+}} - // CHECK-DAG: [[BP3:%[^,]+]] = inttoptr i[[SZ]] [[A_CVAL]] to i8* - // CHECK-DAG: [[P3:%[^,]+]] = inttoptr i[[SZ]] [[A_CVAL]] to i8* - // CHECK-DAG: store i8* [[BP3]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P3]], i8** {{%[^,]+}} + // CHECK-DAG: store i[[SZ]] [[A_CVAL]], i[[SZ]]* [[CBPADDR3:%.+]], + // CHECK-DAG: store i[[SZ]] [[A_CVAL]], i[[SZ]]* [[CPADDR3:%.+]], + // CHECK-DAG: [[CBPADDR3]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* + // CHECK-DAG: [[CPADDR3]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: store i[[SZ]] 4, i[[SZ]]* {{%[^,]+}} - // CHECK-DAG: [[BP4:%[^,]+]] = bitcast [10 x float]* %{{.+}} to i8* - // CHECK-DAG: [[P4:%[^,]+]] = bitcast [10 x float]* %{{.+}} to i8* - // CHECK-DAG: store i8* [[BP4]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P4]], i8** {{%[^,]+}} + // CHECK-DAG: store [10 x float]* %{{.+}}, [10 x float]** [[CBPADDR4:%.+]], + // CHECK-DAG: store [10 x float]* %{{.+}}, [10 x float]** [[CPADDR4:%.+]], + // CHECK-DAG: [[CBPADDR4]] = bitcast i8** {{%[^,]+}} to [10 x float]** + // CHECK-DAG: [[CPADDR4]] = bitcast i8** {{%[^,]+}} to [10 x float]** // CHECK-DAG: store i[[SZ]] 40, i[[SZ]]* {{%[^,]+}} - // CHECK-DAG: [[BP5:%[^,]+]] = bitcast float* %{{.+}} to i8* - // CHECK-DAG: [[P5:%[^,]+]] = bitcast float* %{{.+}} to i8* - // CHECK-DAG: store i8* [[BP5]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P5]], i8** {{%[^,]+}} + // CHECK-DAG: store float* %{{.+}}, float** [[CBPADDR5:%.+]], + // CHECK-DAG: store float* %{{.+}}, float** [[CPADDR5:%.+]], + // CHECK-DAG: [[CBPADDR5]] = bitcast i8** {{%[^,]+}} to float** + // CHECK-DAG: [[CPADDR5]] = bitcast i8** {{%[^,]+}} to float** // CHECK-DAG: store i[[SZ]] [[BNSIZE]], i[[SZ]]* {{%[^,]+}} - // CHECK-DAG: [[BP6:%[^,]+]] = bitcast [5 x [10 x double]]* %{{.+}} to i8* - // CHECK-DAG: [[P6:%[^,]+]] = bitcast [5 x [10 x double]]* %{{.+}} to i8* - // CHECK-DAG: store i8* [[BP6]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P6]], i8** {{%[^,]+}} + // CHECK-DAG: store [5 x [10 x double]]* %{{.+}}, [5 x [10 x double]]** [[CBPADDR6:%.+]], + // CHECK-DAG: store [5 x [10 x double]]* %{{.+}}, [5 x [10 x double]]** [[CPADDR6:%.+]], + // CHECK-DAG: [[CBPADDR6]] = bitcast i8** {{%[^,]+}} to [5 x [10 x double]]** + // CHECK-DAG: [[CPADDR6]] = bitcast i8** {{%[^,]+}} to [5 x [10 x double]]** // CHECK-DAG: store i[[SZ]] 400, i[[SZ]]* {{%[^,]+}} - // CHECK-DAG: [[BP7:%[^,]+]] = bitcast double* %{{.+}} to i8* - // CHECK-DAG: [[P7:%[^,]+]] = bitcast double* %{{.+}} to i8* - // CHECK-DAG: store i8* [[BP7]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P7]], i8** {{%[^,]+}} + // CHECK-DAG: store double* %{{.+}}, double** [[CBPADDR7:%.+]], + // CHECK-DAG: store double* %{{.+}}, double** [[CPADDR7:%.+]], + // CHECK-DAG: [[CBPADDR7]] = bitcast i8** {{%[^,]+}} to double** + // CHECK-DAG: [[CPADDR7]] = bitcast i8** {{%[^,]+}} to double** // CHECK-DAG: store i[[SZ]] [[CNSIZE]], i[[SZ]]* {{%[^,]+}} - // CHECK-DAG: [[BP8:%[^,]+]] = bitcast [[TT]]* %{{.+}} to i8* - // CHECK-DAG: [[P8:%[^,]+]] = bitcast [[TT]]* %{{.+}} to i8* - // CHECK-DAG: store i8* [[BP8]], i8** {{%[^,]+}} - // CHECK-DAG: store i8* [[P8]], i8** {{%[^,]+}} + // CHECK-DAG: store [[TT]]* %{{.+}}, [[TT]]** [[CBPADDR8:%.+]], + // CHECK-DAG: store [[TT]]* %{{.+}}, [[TT]]** [[CPADDR8:%.+]], + // CHECK-DAG: [[CBPADDR8]] = bitcast i8** {{%[^,]+}} to [[TT]]** + // CHECK-DAG: [[CPADDR8]] = bitcast i8** {{%[^,]+}} to [[TT]]** // CHECK-DAG: store i[[SZ]] {{12|16}}, i[[SZ]]* {{%[^,]+}} // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 @@ -550,32 +552,34 @@ int bar(int n){ // The names below are not necessarily consistent with the names used for the // addresses above as some are repeated. -// CHECK-DAG: [[BP0:%[^,]+]] = inttoptr i[[SZ]] [[VLA0]] to i8* -// CHECK-DAG: [[P0:%[^,]+]] = inttoptr i[[SZ]] [[VLA0]] to i8* -// CHECK-DAG: store i8* [[BP0]], i8** {{%[^,]+}} -// CHECK-DAG: store i8* [[P0]], i8** {{%[^,]+}} +// CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CBPADDR0:%.+]], +// CHECK-DAG: store i[[SZ]] [[VLA0]], i[[SZ]]* [[CPADDR0:%.+]], +// CHECK-DAG: [[CBPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* +// CHECK-DAG: [[CPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* {{%[^,]+}} -// CHECK-DAG: store i8* inttoptr (i[[SZ]] 2 to i8*), i8** {{%[^,]+}} -// CHECK-DAG: store i8* inttoptr (i[[SZ]] 2 to i8*), i8** {{%[^,]+}} +// CHECK-DAG: store i[[SZ]] 2, i[[SZ]]* [[CBPADDR1:%.+]], +// CHECK-DAG: store i[[SZ]] 2, i[[SZ]]* [[CPADDR1:%.+]], +// CHECK-DAG: [[CBPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* +// CHECK-DAG: [[CPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: store i[[SZ]] {{4|8}}, i[[SZ]]* {{%[^,]+}} -// CHECK-DAG: [[BP2:%[^,]+]] = inttoptr i[[SZ]] [[B_CVAL]] to i8* -// CHECK-DAG: [[P2:%[^,]+]] = inttoptr i[[SZ]] [[B_CVAL]] to i8* -// CHECK-DAG: store i8* [[BP2]], i8** {{%[^,]+}} -// CHECK-DAG: store i8* [[P2]], i8** {{%[^,]+}} +// CHECK-DAG: store i[[SZ]] [[B_CVAL]], i[[SZ]]* [[CBPADDR2:%.+]], +// CHECK-DAG: store i[[SZ]] [[B_CVAL]], i[[SZ]]* [[CPADDR2:%.+]], +// CHECK-DAG: [[CBPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* +// CHECK-DAG: [[CPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: store i[[SZ]] 4, i[[SZ]]* {{%[^,]+}} -// CHECK-DAG: [[BP3:%[^,]+]] = bitcast [[S1]]* %{{.+}} to i8* -// CHECK-DAG: [[P3:%[^,]+]] = bitcast [[S1]]* %{{.+}} to i8* -// CHECK-DAG: store i8* [[BP3]], i8** {{%[^,]+}} -// CHECK-DAG: store i8* [[P3]], i8** {{%[^,]+}} +// CHECK-DAG: store [[S1]]* %{{.+}}, [[S1]]** [[CBPADDR3:%.+]], +// CHECK-DAG: store [[S1]]* %{{.+}}, [[S1]]** [[CPADDR3:%.+]], +// CHECK-DAG: [[CBPADDR3]] = bitcast i8** {{%[^,]+}} to [[S1]]** +// CHECK-DAG: [[CPADDR3]] = bitcast i8** {{%[^,]+}} to [[S1]]** // CHECK-DAG: store i[[SZ]] 8, i[[SZ]]* {{%[^,]+}} -// CHECK-DAG: [[BP4:%[^,]+]] = bitcast i16* %{{.+}} to i8* -// CHECK-DAG: [[P4:%[^,]+]] = bitcast i16* %{{.+}} to i8* -// CHECK-DAG: store i8* [[BP4]], i8** {{%[^,]+}} -// CHECK-DAG: store i8* [[P4]], i8** {{%[^,]+}} +// CHECK-DAG: store i16* %{{.+}}, i16** [[CBPADDR4:%.+]], +// CHECK-DAG: store i16* %{{.+}}, i16** [[CPADDR4:%.+]], +// CHECK-DAG: [[CBPADDR4]] = bitcast i8** {{%[^,]+}} to i16** +// CHECK-DAG: [[CPADDR4]] = bitcast i8** {{%[^,]+}} to i16** // CHECK-DAG: store i[[SZ]] [[CSIZE]], i[[SZ]]* {{%[^,]+}} // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 @@ -600,29 +604,31 @@ int bar(int n){ // CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[BP]], i32 0, i32 0 // CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[P]], i32 0, i32 0 -// CHECK-DAG: store i8* [[BP0:%[^,]+]], i8** [[BPADDR0]] -// CHECK-DAG: store i8* [[P0:%[^,]+]], i8** [[PADDR0]] -// CHECK-DAG: [[BP0]] = inttoptr i[[SZ]] [[VAL0:%.+]] to i8* -// CHECK-DAG: [[P0]] = inttoptr i[[SZ]] [[VAL0]] to i8* +// CHECK-DAG: store i[[SZ]] [[VAL0:%.+]], i[[SZ]]* [[CBPADDR0:%.+]], +// CHECK-DAG: store i[[SZ]] [[VAL0]], i[[SZ]]* [[CPADDR0:%.+]], +// CHECK-DAG: [[CBPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* +// CHECK-DAG: [[CPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[BP]], i32 0, i32 1 // CHECK-DAG: [[PADDR1:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[P]], i32 0, i32 1 -// CHECK-DAG: store i8* [[BP1:%[^,]+]], i8** [[BPADDR1]] -// CHECK-DAG: store i8* [[P1:%[^,]+]], i8** [[PADDR1]] -// CHECK-DAG: [[BP1]] = inttoptr i[[SZ]] [[VAL1:%.+]] to i8* -// CHECK-DAG: [[P1]] = inttoptr i[[SZ]] [[VAL1]] to i8* +// CHECK-DAG: store i[[SZ]] [[VAL1:%.+]], i[[SZ]]* [[CBPADDR1:%.+]], +// CHECK-DAG: store i[[SZ]] [[VAL1]], i[[SZ]]* [[CPADDR1:%.+]], +// CHECK-DAG: [[CBPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* +// CHECK-DAG: [[CPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[BP]], i32 0, i32 2 // CHECK-DAG: [[PADDR2:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[P]], i32 0, i32 2 -// CHECK-DAG: store i8* [[BP2:%[^,]+]], i8** [[BPADDR2]] -// CHECK-DAG: store i8* [[P2:%[^,]+]], i8** [[PADDR2]] +// CHECK-DAG: store i[[SZ]] [[VAL2:%.+]], i[[SZ]]* [[CBPADDR2:%.+]], +// CHECK-DAG: store i[[SZ]] [[VAL2]], i[[SZ]]* [[CPADDR2:%.+]], +// CHECK-DAG: [[CBPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* +// CHECK-DAG: [[CPADDR2]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: [[BPADDR3:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[BP]], i32 0, i32 3 // CHECK-DAG: [[PADDR3:%.+]] = getelementptr inbounds [4 x i8*], [4 x i8*]* [[P]], i32 0, i32 3 -// CHECK-DAG: store i8* [[BP3:%[^,]+]], i8** [[BPADDR3]] -// CHECK-DAG: store i8* [[P3:%[^,]+]], i8** [[PADDR3]] -// CHECK-DAG: [[BP3]] = bitcast [10 x i32]* %{{.+}} to i8* -// CHECK-DAG: [[P3]] = bitcast [10 x i32]* %{{.+}} to i8* +// CHECK-DAG: store [10 x i32]* %{{.+}}, [10 x i32]** [[CBPADDR3:%.+]], +// CHECK-DAG: store [10 x i32]* %{{.+}}, [10 x i32]** [[CPADDR3:%.+]], +// CHECK-DAG: [[CBPADDR3]] = bitcast i8** {{%[^,]+}} to [10 x i32]** +// CHECK-DAG: [[CPADDR3]] = bitcast i8** {{%[^,]+}} to [10 x i32]** // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 // CHECK-NEXT: br label %[[IFEND:.+]] @@ -652,24 +658,24 @@ int bar(int n){ // CHECK-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BP]], i32 0, i32 0 // CHECK-DAG: [[PADDR0:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[P]], i32 0, i32 0 -// CHECK-DAG: store i8* [[BP0:%[^,]+]], i8** [[BPADDR0]] -// CHECK-DAG: store i8* [[P0:%[^,]+]], i8** [[PADDR0]] -// CHECK-DAG: [[BP0]] = inttoptr i[[SZ]] [[VAL0:%.+]] to i8* -// CHECK-DAG: [[P0]] = inttoptr i[[SZ]] [[VAL0]] to i8* +// CHECK-DAG: store i[[SZ]] [[VAL0:%.+]], i[[SZ]]* [[CBPADDR0:%.+]], +// CHECK-DAG: store i[[SZ]] [[VAL0]], i[[SZ]]* [[CPADDR0:%.+]], +// CHECK-DAG: [[CBPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* +// CHECK-DAG: [[CPADDR0]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BP]], i32 0, i32 1 // CHECK-DAG: [[PADDR1:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[P]], i32 0, i32 1 -// CHECK-DAG: store i8* [[BP1:%[^,]+]], i8** [[BPADDR1]] -// CHECK-DAG: store i8* [[P1:%[^,]+]], i8** [[PADDR1]] -// CHECK-DAG: [[BP1]] = inttoptr i[[SZ]] [[VAL1:%.+]] to i8* -// CHECK-DAG: [[P1]] = inttoptr i[[SZ]] [[VAL1]] to i8* +// CHECK-DAG: store i[[SZ]] [[VAL1:%.+]], i[[SZ]]* [[CBPADDR1:%.+]], +// CHECK-DAG: store i[[SZ]] [[VAL1]], i[[SZ]]* [[CPADDR1:%.+]], +// CHECK-DAG: [[CBPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* +// CHECK-DAG: [[CPADDR1]] = bitcast i8** {{%[^,]+}} to i[[SZ]]* // CHECK-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[BP]], i32 0, i32 2 // CHECK-DAG: [[PADDR2:%.+]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[P]], i32 0, i32 2 -// CHECK-DAG: store i8* [[BP2:%[^,]+]], i8** [[BPADDR2]] -// CHECK-DAG: store i8* [[P2:%[^,]+]], i8** [[PADDR2]] -// CHECK-DAG: [[BP2]] = bitcast [10 x i32]* %{{.+}} to i8* -// CHECK-DAG: [[P2]] = bitcast [10 x i32]* %{{.+}} to i8* +// CHECK-DAG: store [10 x i32]* [[VAL2:%.+]], [10 x i32]** [[CBPADDR2:%.+]], +// CHECK-DAG: store [10 x i32]* [[VAL2]], [10 x i32]** [[CPADDR2:%.+]], +// CHECK-DAG: [[CBPADDR2]] = bitcast i8** {{%[^,]+}} to [10 x i32]** +// CHECK-DAG: [[CPADDR2]] = bitcast i8** {{%[^,]+}} to [10 x i32]** // CHECK: store i32 [[RET]], i32* [[RHV:%.+]], align 4 // CHECK-NEXT: br label %[[IFEND:.+]] diff --git a/test/OpenMP/target_update_codegen.cpp b/test/OpenMP/target_update_codegen.cpp index f74ed4997537..f1e61a54c6e2 100644 --- a/test/OpenMP/target_update_codegen.cpp +++ b/test/OpenMP/target_update_codegen.cpp @@ -45,8 +45,10 @@ void foo(int arg) { // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK1-DAG: store i8* bitcast ([100 x double]* @gc to i8*), i8** [[BP0]] - // CK1-DAG: store i8* bitcast ([100 x double]* @gc to i8*), i8** [[P0]] + // CK1-DAG: [[BPC0:%.+]] = bitcast i8** [[BP0]] to [100 x double]** + // CK1-DAG: [[PC0:%.+]] = bitcast i8** [[P0]] to [100 x double]** + // CK1-DAG: store [100 x double]* @gc, [100 x double]** [[BPC0]] + // CK1-DAG: store [100 x double]* @gc, [100 x double]** [[PC0]] // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1 #pragma omp target update if(1+3-5) device(arg) from(gc) @@ -66,10 +68,10 @@ void foo(int arg) { // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK1-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK1-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] - // CK1-DAG: [[CBPVAL0]] = bitcast i32* [[VAR0:%.+]] to i8* - // CK1-DAG: [[CPVAL0]] = bitcast i32* [[VAR0]] to i8* + // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to i32** + // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to i32** + // CK1-DAG: store i32* [[VAL0:%[^,]+]], i32** [[CBP0]] + // CK1-DAG: store i32* [[VAL0]], i32** [[CP0]] // CK1: br label %[[IFEND:[^,]+]] // CK1: [[IFELSE]] @@ -91,11 +93,11 @@ void foo(int arg) { // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[S0:%.+]] = getelementptr inbounds {{.+}}[[S]], i{{.+}} 0, i{{.+}} 0 - // CK1-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] - // CK1-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] + // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to float** + // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to float** + // CK1-DAG: store float* [[VAL0:%[^,]+]], float** [[CBP0]] + // CK1-DAG: store float* [[VAL0]], float** [[CP0]] // CK1-DAG: store i[[sz]] [[CSVAL0:%[^,]+]], i[[sz]]* [[S0]] - // CK1-DAG: [[CBPVAL0]] = bitcast float* [[VAR0:%.+]] to i8* - // CK1-DAG: [[CPVAL0]] = bitcast float* [[VAR0]] to i8* // CK1-DAG: [[CSVAL0]] = mul nuw i[[sz]] %{{[^,]+}}, 4 // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1 // CK1-NOT: __tgt_target_data_end @@ -112,16 +114,19 @@ void foo(int arg) { // CK1-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK1-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 - // CK1-DAG: store i8* bitcast ([[ST]]* @gb to i8*), i8** [[BP0]] - // CK1-DAG: store i8* bitcast (double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1) to i8*), i8** [[P0]] + // CK1-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** + // CK1-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to double*** + // CK1-DAG: store [[ST]]* @gb, [[ST]]** [[CBP0]] + // CK1-DAG: store double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1), double*** [[CP0]] // CK1-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK1-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 - // CK1-DAG: store i8* bitcast (double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1) to i8*), i8** [[BP1]] - // CK1-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] - // CK1-DAG: [[CPVAL1]] = bitcast double* [[SEC1:%.+]] to i8* - // CK1-DAG: [[SEC1]] = getelementptr inbounds {{.+}}double* [[SEC11:%[^,]+]], i{{.+}} 0 + // CK1-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double*** + // CK1-DAG: store double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1), double*** [[CBP1]] + // CK1-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double** + // CK1-DAG: store double* [[VAL1:%[^,]+]], double** [[CP1]] + // CK1-DAG: [[VAL1]] = getelementptr inbounds {{.+}}double* [[SEC11:%.+]], i{{.+}} 0 // CK1-DAG: [[SEC11]] = load double*, double** getelementptr inbounds ([[ST]], [[ST]]* @gb, i32 0, i32 1), // CK1: %{{.+}} = add nsw i32 %{{[^,]+}}, 1 @@ -172,19 +177,19 @@ int bar(int arg){ // CK2-DAG: [[BP0:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 0 // CK2-DAG: [[P0:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 0 -// CK2-DAG: store i8* [[CBPVAL0:%[^,]+]], i8** [[BP0]] -// CK2-DAG: store i8* [[CPVAL0:%[^,]+]], i8** [[P0]] -// CK2-DAG: [[CBPVAL0]] = bitcast [[ST]]* [[VAR0:%.+]] to i8* -// CK2-DAG: [[CPVAL0]] = bitcast double** [[SEC0:%[^,]+]] to i8* +// CK2-DAG: [[CBP0:%.+]] = bitcast i8** [[BP0]] to [[ST]]** +// CK2-DAG: [[CP0:%.+]] = bitcast i8** [[P0]] to double*** +// CK2-DAG: store [[ST]]* [[VAR0:%[^,]+]], [[ST]]** [[CBP0]] +// CK2-DAG: store double** [[SEC0:%[^,]+]], double*** [[CP0]] // CK2-DAG: [[SEC0]] = getelementptr inbounds {{.*}}[[ST]]* [[VAR0]], i32 0, i32 1 // CK2-DAG: [[BP1:%.+]] = getelementptr inbounds {{.+}}[[BP]], i{{.+}} 0, i{{.+}} 1 // CK2-DAG: [[P1:%.+]] = getelementptr inbounds {{.+}}[[P]], i{{.+}} 0, i{{.+}} 1 -// CK2-DAG: store i8* [[CBPVAL1:%[^,]+]], i8** [[BP1]] -// CK2-DAG: store i8* [[CPVAL1:%[^,]+]], i8** [[P1]] -// CK2-DAG: [[CBPVAL1]] = bitcast double** [[SEC0]] to i8* -// CK2-DAG: [[CPVAL1]] = bitcast double* [[SEC1:%[^,]+]] to i8* +// CK2-DAG: [[CBP1:%.+]] = bitcast i8** [[BP1]] to double*** +// CK2-DAG: [[CP1:%.+]] = bitcast i8** [[P1]] to double** +// CK2-DAG: store double** [[CBPVAL1:%[^,]+]], double*** [[CBP1]] +// CK2-DAG: store double* [[SEC1:%[^,]+]], double** [[CP1]] // CK2-DAG: [[SEC1]] = getelementptr inbounds {{.*}}double* [[SEC11:%[^,]+]], i{{.+}} 1 // CK2-DAG: [[SEC11]] = load double*, double** [[SEC111:%[^,]+]], // CK2-DAG: [[SEC111]] = getelementptr inbounds {{.*}}[[ST]]* [[VAR0]], i32 0, i32 1 diff --git a/test/OpenMP/taskloop_ast_print.cpp b/test/OpenMP/taskloop_ast_print.cpp index d2fae3fe0f4f..36f90c95dd33 100644 --- a/test/OpenMP/taskloop_ast_print.cpp +++ b/test/OpenMP/taskloop_ast_print.cpp @@ -13,14 +13,14 @@ T tmain(T argc) { T b = argc, c, d, e, f, g; static T a; // CHECK: static T a; -#pragma omp taskloop if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) - // CHECK-NEXT: #pragma omp taskloop if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) +#pragma omp taskloop if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+:g) + // CHECK-NEXT: #pragma omp taskloop if(taskloop: argc > N) default(shared) untied priority(N) grainsize(N) reduction(+: g) for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; #pragma omp parallel -#pragma omp taskloop private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) shared(g) if (c) final(d) mergeable priority(f) nogroup num_tasks(N) +#pragma omp taskloop private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) shared(g) if (c) final(d) mergeable priority(f) nogroup num_tasks(N) reduction(min:a) for (int i = 0; i < 2; ++i) for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) @@ -33,7 +33,7 @@ T tmain(T argc) { for (int j = 0; j < 2; ++j) foo(); // CHECK-NEXT: #pragma omp parallel - // CHECK-NEXT: #pragma omp taskloop private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) shared(g) if(c) final(d) mergeable priority(f) nogroup num_tasks(N) + // CHECK-NEXT: #pragma omp taskloop private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) shared(g) if(c) final(d) mergeable priority(f) nogroup num_tasks(N) reduction(min: a) // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: for (int j = 0; j < 2; ++j) // CHECK-NEXT: for (int j = 0; j < 2; ++j) @@ -53,19 +53,19 @@ int main(int argc, char **argv) { int b = argc, c, d, e, f, g; static int a; // CHECK: static int a; -#pragma omp taskloop if(taskloop: a) default(none) shared(a) final(b) priority(5) nogroup num_tasks(argc) - // CHECK-NEXT: #pragma omp taskloop if(taskloop: a) default(none) shared(a) final(b) priority(5) nogroup num_tasks(argc) +#pragma omp taskloop if(taskloop: a) default(none) shared(a) final(b) priority(5) nogroup num_tasks(argc) reduction(*: g) + // CHECK-NEXT: #pragma omp taskloop if(taskloop: a) default(none) shared(a) final(b) priority(5) nogroup num_tasks(argc) reduction(*: g) for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; #pragma omp parallel -#pragma omp taskloop private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(argc) mergeable priority(argc) grainsize(argc) +#pragma omp taskloop private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(argc) mergeable priority(argc) grainsize(argc) reduction(max: a, e) for (int i = 0; i < 10; ++i) for (int j = 0; j < 10; ++j) foo(); // CHECK-NEXT: #pragma omp parallel - // CHECK-NEXT: #pragma omp taskloop private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(argc) mergeable priority(argc) grainsize(argc) + // CHECK-NEXT: #pragma omp taskloop private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(argc) mergeable priority(argc) grainsize(argc) reduction(max: a,e) // CHECK-NEXT: for (int i = 0; i < 10; ++i) // CHECK-NEXT: for (int j = 0; j < 10; ++j) // CHECK-NEXT: foo(); diff --git a/test/OpenMP/taskloop_simd_ast_print.cpp b/test/OpenMP/taskloop_simd_ast_print.cpp index f16b470a3012..9bee8f7f93fd 100644 --- a/test/OpenMP/taskloop_simd_ast_print.cpp +++ b/test/OpenMP/taskloop_simd_ast_print.cpp @@ -14,14 +14,14 @@ T tmain(T argc) { T *ptr; static T a; // CHECK: static T a; -#pragma omp taskloop simd if(taskloop: argc > N) default(shared) untied priority(N) safelen(N) linear(c) aligned(ptr) grainsize(N) - // CHECK-NEXT: #pragma omp taskloop simd if(taskloop: argc > N) default(shared) untied priority(N) safelen(N) linear(c) aligned(ptr) grainsize(N) +#pragma omp taskloop simd if(taskloop: argc > N) default(shared) untied priority(N) safelen(N) linear(c) aligned(ptr) grainsize(N) reduction(+:g) + // CHECK-NEXT: #pragma omp taskloop simd if(taskloop: argc > N) default(shared) untied priority(N) safelen(N) linear(c) aligned(ptr) grainsize(N) reduction(+: g) for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; #pragma omp parallel -#pragma omp taskloop simd private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) shared(g) if (c) final(d) mergeable priority(f) simdlen(N) nogroup num_tasks(N) +#pragma omp taskloop simd private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) shared(g) if (c) final(d) mergeable priority(f) simdlen(N) nogroup num_tasks(N) reduction(min:a) for (int i = 0; i < 2; ++i) for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) @@ -34,7 +34,7 @@ T tmain(T argc) { for (int j = 0; j < 2; ++j) foo(); // CHECK-NEXT: #pragma omp parallel - // CHECK-NEXT: #pragma omp taskloop simd private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) shared(g) if(c) final(d) mergeable priority(f) simdlen(N) nogroup num_tasks(N) + // CHECK-NEXT: #pragma omp taskloop simd private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) shared(g) if(c) final(d) mergeable priority(f) simdlen(N) nogroup num_tasks(N) reduction(min: a) // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: for (int j = 0; j < 2; ++j) // CHECK-NEXT: for (int j = 0; j < 2; ++j) @@ -54,19 +54,19 @@ int main(int argc, char **argv) { int b = argc, c, d, e, f, g; static int a; // CHECK: static int a; -#pragma omp taskloop simd if(taskloop: a) default(none) shared(a) final(b) priority(5) safelen(8) linear(b), aligned(argv) nogroup num_tasks(argc) - // CHECK-NEXT: #pragma omp taskloop simd if(taskloop: a) default(none) shared(a) final(b) priority(5) safelen(8) linear(b) aligned(argv) nogroup num_tasks(argc) +#pragma omp taskloop simd if(taskloop: a) default(none) shared(a) final(b) priority(5) safelen(8) linear(b), aligned(argv) nogroup num_tasks(argc) reduction(*: g) + // CHECK-NEXT: #pragma omp taskloop simd if(taskloop: a) default(none) shared(a) final(b) priority(5) safelen(8) linear(b) aligned(argv) nogroup num_tasks(argc) reduction(*: g) for (int i = 0; i < 2; ++i) a = 2; // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: a = 2; #pragma omp parallel -#pragma omp taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(argc) mergeable priority(argc) simdlen(16) grainsize(argc) +#pragma omp taskloop simd private(argc, b), firstprivate(argv, c), lastprivate(d, f) collapse(2) shared(g) if(argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a, e) for (int i = 0; i < 10; ++i) for (int j = 0; j < 10; ++j) foo(); // CHECK-NEXT: #pragma omp parallel - // CHECK-NEXT: #pragma omp taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(argc) mergeable priority(argc) simdlen(16) grainsize(argc) + // CHECK-NEXT: #pragma omp taskloop simd private(argc,b) firstprivate(argv,c) lastprivate(d,f) collapse(2) shared(g) if(argc) mergeable priority(argc) simdlen(16) grainsize(argc) reduction(max: a,e) // CHECK-NEXT: for (int i = 0; i < 10; ++i) // CHECK-NEXT: for (int j = 0; j < 10; ++j) // CHECK-NEXT: foo(); diff --git a/test/PCH/attrs.c b/test/PCH/attrs.c index 3f34d4d00908..3bf660cf28e0 100644 --- a/test/PCH/attrs.c +++ b/test/PCH/attrs.c @@ -13,8 +13,9 @@ int g(int) __attribute__((abi_tag("foo", "bar", "baz"), no_sanitize("address", " #else +float f(float); double f(double); // expected-error{{overloadable}} - // expected-note@11{{previous overload}} + // expected-note@-2{{previous unmarked overload}} void h() { g(0); } #endif diff --git a/test/Preprocessor/aarch64-target-features.c b/test/Preprocessor/aarch64-target-features.c index 43a050b14c06..721246aff3a7 100644 --- a/test/Preprocessor/aarch64-target-features.c +++ b/test/Preprocessor/aarch64-target-features.c @@ -71,8 +71,9 @@ // CHECK-NEON: __ARM_NEON 1 // CHECK-NEON: __ARM_NEON_FP 0xE -// RUN: %clang -target aarch64-none-eabi -march=armv8.1-a -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-V81A %s -// CHECK-V81A: __ARM_FEATURE_QRDMX 1 +// RUN: %clang -target aarch64-none-eabi -march=armv8.1-a -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-QRDMX %s +// RUN: %clang -target aarch64-none-eabi -march=armv8.2-a -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-QRDMX %s +// CHECK-QRDMX: __ARM_FEATURE_QRDMX 1 // RUN: %clang -target aarch64 -march=arm64 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-ARCH-NOT-ACCEPT %s // RUN: %clang -target aarch64 -march=aarch64 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-ARCH-NOT-ACCEPT %s diff --git a/test/Preprocessor/arm-target-features.c b/test/Preprocessor/arm-target-features.c index 81dab475fc9d..b206e1cf36fd 100644 --- a/test/Preprocessor/arm-target-features.c +++ b/test/Preprocessor/arm-target-features.c @@ -441,4 +441,5 @@ // CHECK-V82A: #define __ARM_ARCH 8 // CHECK-V82A: #define __ARM_ARCH_8_2A__ 1 // CHECK-V82A: #define __ARM_ARCH_PROFILE 'A' +// CHECK-V82A: #define __ARM_FEATURE_QRDMX 1 // CHECK-V82A: #define __ARM_FP 0xE diff --git a/test/Preprocessor/predefined-arch-macros.c b/test/Preprocessor/predefined-arch-macros.c index 08f4d2573f40..da4c5d03574b 100644 --- a/test/Preprocessor/predefined-arch-macros.c +++ b/test/Preprocessor/predefined-arch-macros.c @@ -986,6 +986,81 @@ // CHECK_ATOM_M64: #define __x86_64 1 // CHECK_ATOM_M64: #define __x86_64__ 1 // +// RUN: %clang -march=goldmont -m32 -E -dM %s -o - 2>&1 \ +// RUN: -target i386-unknown-linux \ +// RUN: | FileCheck %s -check-prefix=CHECK_GLM_M32 +// CHECK_GLM_M32: #define __AES__ 1 +// CHECK_GLM_M32: #define __CLFLUSHOPT__ 1 +// CHECK_GLM_M32: #define __FXSR__ 1 +// CHECK_GLM_M32: #define __MMX__ 1 +// CHECK_GLM_M32: #define __MPX__ 1 +// CHECK_GLM_M32: #define __PCLMUL__ 1 +// CHECK_GLM_M32: #define __POPCNT__ 1 +// CHECK_GLM_M32: #define __RDRND__ 1 +// CHECK_GLM_M32: #define __RDSEED__ 1 +// CHECK_GLM_M32: #define __SHA__ 1 +// CHECK_GLM_M32: #define __SSE2__ 1 +// CHECK_GLM_M32: #define __SSE3__ 1 +// CHECK_GLM_M32: #define __SSE4_1__ 1 +// CHECK_GLM_M32: #define __SSE4_2__ 1 +// CHECK_GLM_M32: #define __SSE_MATH__ 1 +// CHECK_GLM_M32: #define __SSE__ 1 +// CHECK_GLM_M32: #define __SSSE3__ 1 +// CHECK_GLM_M32: #define __XSAVEC__ 1 +// CHECK_GLM_M32: #define __XSAVEOPT__ 1 +// CHECK_GLM_M32: #define __XSAVES__ 1 +// CHECK_GLM_M32: #define __XSAVE__ 1 +// CHECK_GLM_M32: #define __clang__ 1 +// CHECK_GLM_M32: #define __goldmont 1 +// CHECK_GLM_M32: #define __goldmont__ 1 +// CHECK_GLM_M32: #define __i386 1 +// CHECK_GLM_M32: #define __i386__ 1 +// CHECK_GLM_M32: #define __linux 1 +// CHECK_GLM_M32: #define __linux__ 1 +// CHECK_GLM_M32: #define __llvm__ 1 +// CHECK_GLM_M32: #define __tune_goldmont__ 1 +// CHECK_GLM_M32: #define __unix 1 +// CHECK_GLM_M32: #define __unix__ 1 +// CHECK_GLM_M32: #define i386 1 +// CHECK_GLM_M32: #define linux 1 +// CHECK_GLM_M32: #define unix 1 +// +// RUN: %clang -march=goldmont -m64 -E -dM %s -o - 2>&1 \ +// RUN: -target i386-unknown-linux \ +// RUN: | FileCheck %s -check-prefix=CHECK_GLM_M64 +// CHECK_GLM_M64: #define __AES__ 1 +// CHECK_GLM_M64: #define __CLFLUSHOPT__ 1 +// CHECK_GLM_M64: #define __FXSR__ 1 +// CHECK_GLM_M64: #define __MMX__ 1 +// CHECK_GLM_M64: #define __MPX__ 1 +// CHECK_GLM_M64: #define __PCLMUL__ 1 +// CHECK_GLM_M64: #define __POPCNT__ 1 +// CHECK_GLM_M64: #define __RDRND__ 1 +// CHECK_GLM_M64: #define __RDSEED__ 1 +// CHECK_GLM_M64: #define __SSE2__ 1 +// CHECK_GLM_M64: #define __SSE3__ 1 +// CHECK_GLM_M64: #define __SSE4_1__ 1 +// CHECK_GLM_M64: #define __SSE4_2__ 1 +// CHECK_GLM_M64: #define __SSE__ 1 +// CHECK_GLM_M64: #define __SSSE3__ 1 +// CHECK_GLM_M64: #define __XSAVEC__ 1 +// CHECK_GLM_M64: #define __XSAVEOPT__ 1 +// CHECK_GLM_M64: #define __XSAVES__ 1 +// CHECK_GLM_M64: #define __XSAVE__ 1 +// CHECK_GLM_M64: #define __gnu_linux__ 1 +// CHECK_GLM_M64: #define __goldmont 1 +// CHECK_GLM_M64: #define __goldmont__ 1 +// CHECK_GLM_M64: #define __linux 1 +// CHECK_GLM_M64: #define __linux__ 1 +// CHECK_GLM_M64: #define __llvm__ 1 +// CHECK_GLM_M64: #define __tune_goldmont__ 1 +// CHECK_GLM_M64: #define __unix 1 +// CHECK_GLM_M64: #define __unix__ 1 +// CHECK_GLM_M64: #define __x86_64 1 +// CHECK_GLM_M64: #define __x86_64__ 1 +// CHECK_GLM_M64: #define linux 1 +// CHECK_GLM_M64: #define unix 1 +// // RUN: %clang -march=slm -m32 -E -dM %s -o - 2>&1 \ // RUN: -target i386-unknown-linux \ // RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SLM_M32 diff --git a/test/Preprocessor/predefined-macros.c b/test/Preprocessor/predefined-macros.c index 7385cd2c93ef..662a712d6477 100644 --- a/test/Preprocessor/predefined-macros.c +++ b/test/Preprocessor/predefined-macros.c @@ -185,3 +185,9 @@ // CHECK-CL20-NOT: #define __FAST_RELAXED_MATH__ 1 // CHECK-FRM: #define __FAST_RELAXED_MATH__ 1 +// RUN: %clang_cc1 -triple aarch64-windows %s -E -dM -o - -x cl \ +// RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM64-WIN + +// CHECK-ARM64-WIN: #define _M_ARM64 1 +// CHECK-ARM64-WIN: #define _WIN32 1 +// CHECK-ARM64-WIN: #define _WIN64 1 diff --git a/test/Profile/Inputs/cxx-missing-bodies.proftext b/test/Profile/Inputs/cxx-missing-bodies.proftext new file mode 100644 index 000000000000..c07f297f74d1 --- /dev/null +++ b/test/Profile/Inputs/cxx-missing-bodies.proftext @@ -0,0 +1,9 @@ +??_GA@@UAEPAXI@Z +1 +1 +1 + +??_DA@@QAEXXZ +1 +1 +1 diff --git a/test/Profile/cxx-missing-bodies.cpp b/test/Profile/cxx-missing-bodies.cpp new file mode 100644 index 000000000000..fe926b3b2182 --- /dev/null +++ b/test/Profile/cxx-missing-bodies.cpp @@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -emit-llvm %s -std=c++11 -S -emit-llvm -o - -triple=i386-pc-win32 -fno-rtti -fprofile-instrument=clang | FileCheck %s --check-prefix=GEN +// +// Don't crash when presented profile data for functions without bodies: +// RUN: llvm-profdata merge %S/Inputs/cxx-missing-bodies.proftext -o %t.profdata +// RUN: %clang_cc1 -emit-llvm %s -std=c++11 -S -emit-llvm -o /dev/null -triple=i386-pc-win32 -fno-rtti -fprofile-instrument-use-path=%t.profdata -w + +// GEN-NOT: __profn{{.*}}??_GA@@UAEPAXI@Z +// GEN-NOT: __profn{{.*}}??_DA@@QAEXXZ + +struct A { + virtual ~A(); +}; +struct B : A { + virtual ~B(); +}; + +B::~B() {} + +void foo() { + B c; +} diff --git a/test/Profile/cxx-structors.cpp b/test/Profile/cxx-structors.cpp index 8e0fac163d97..1af01babf3b1 100644 --- a/test/Profile/cxx-structors.cpp +++ b/test/Profile/cxx-structors.cpp @@ -33,7 +33,7 @@ Baz baz; Baz baz2(1); Quux qux("fi", "fo", "fum"); -// Profile data for complete constructors and destructors must absent. +// Profile data for complete constructors and destructors must be absent. // INSTR: @__profc__ZN3BazC1Ev = // INSTR: @__profc__ZN3BazC1Ei = diff --git a/test/Sema/diagnose_if.c b/test/Sema/diagnose_if.c index 27689f49b431..38a3307d924a 100644 --- a/test/Sema/diagnose_if.c +++ b/test/Sema/diagnose_if.c @@ -153,3 +153,7 @@ void runAlwaysWarnWithArg(int a) { // Test that diagnose_if warnings generated in system headers are not ignored. #include "Inputs/diagnose-if-warn-system-header.h" + +// Bug: we would complain about `a` being undeclared if this was spelled +// __diagnose_if__. +void underbarName(int a) __attribute__((__diagnose_if__(a, "", "warning"))); diff --git a/test/Sema/integer-overflow.c b/test/Sema/integer-overflow.c index 62ee33e3d181..44c2629ebf7b 100644 --- a/test/Sema/integer-overflow.c +++ b/test/Sema/integer-overflow.c @@ -152,13 +152,7 @@ uint64_t check_integer_overflows(int i) { uint64_t b2 = b[4608 * 1024 * 1024] + 1; // expected-warning@+1 2{{overflow in expression; result is 536870912 with type 'int'}} - int j1 = i ? (4608 * 1024 * 1024) : (4608 * 1024 * 1024); - -// expected-warning@+1 {{overflow in expression; result is 536870912 with type 'int'}} - int j2 = -(4608 * 1024 * 1024); - -// expected-warning@+1 {{overflow in expression; result is 536870912 with type 'int'}} - uint64_t j3 = b[4608 * 1024 * 1024]; + (void)((i ? (4608 * 1024 * 1024) : (4608 * 1024 * 1024)) + 1); // expected-warning@+1 2{{overflow in expression; result is 536870912 with type 'int'}} return ((4608 * 1024 * 1024) + ((uint64_t)(4608 * 1024 * 1024))); diff --git a/test/Sema/overloadable.c b/test/Sema/overloadable.c index be9b862f2934..4bdec85f9ca9 100644 --- a/test/Sema/overloadable.c +++ b/test/Sema/overloadable.c @@ -3,12 +3,15 @@ int var __attribute__((overloadable)); // expected-error{{'overloadable' attribute only applies to functions}} void params(void) __attribute__((overloadable(12))); // expected-error {{'overloadable' attribute takes no arguments}} -int *f(int) __attribute__((overloadable)); // expected-note 2{{previous overload of function is here}} -float *f(float); // expected-error{{overloaded function 'f' must have the 'overloadable' attribute}} +int *f(int) __attribute__((overloadable)); // expected-note{{previous overload of function is here}} +float *f(float); int *f(int); // expected-error{{redeclaration of 'f' must have the 'overloadable' attribute}} \ // expected-note{{previous declaration is here}} double *f(double) __attribute__((overloadable)); // okay, new +// Ensure we don't complain about overloadable on implicitly declared functions. +int isdigit(int) __attribute__((overloadable)); + void test_f(int iv, float fv, double dv) { int *ip = f(iv); float *fp = f(fv); @@ -71,19 +74,19 @@ void test() { f1(); } -void before_local_1(int) __attribute__((overloadable)); // expected-note {{here}} +void before_local_1(int) __attribute__((overloadable)); void before_local_2(int); // expected-note {{here}} void before_local_3(int) __attribute__((overloadable)); void local() { - void before_local_1(char); // expected-error {{must have the 'overloadable' attribute}} - void before_local_2(char) __attribute__((overloadable)); // expected-error {{conflicting types}} + void before_local_1(char); + void before_local_2(char); // expected-error {{conflicting types}} void before_local_3(char) __attribute__((overloadable)); - void after_local_1(char); // expected-note {{here}} - void after_local_2(char) __attribute__((overloadable)); // expected-note {{here}} + void after_local_1(char); + void after_local_2(char) __attribute__((overloadable)); void after_local_3(char) __attribute__((overloadable)); } -void after_local_1(int) __attribute__((overloadable)); // expected-error {{conflicting types}} -void after_local_2(int); // expected-error {{must have the 'overloadable' attribute}} +void after_local_1(int) __attribute__((overloadable)); +void after_local_2(int); void after_local_3(int) __attribute__((overloadable)); // Make sure we allow C-specific conversions in C. @@ -152,6 +155,85 @@ void dropping_qualifiers_is_incompatible() { foo(vcharbuf); // expected-error{{call to 'foo' is ambiguous}} expected-note@-4{{candidate function}} expected-note@-3{{candidate function}} } +void overloadable_with_global() { + void wg_foo(void) __attribute__((overloadable)); // expected-note{{previous}} + void wg_foo(int) __attribute__((overloadable)); +} + +int wg_foo; // expected-error{{redefinition of 'wg_foo' as different kind of symbol}} + +#if !__has_extension(overloadable_unmarked) +#error "We should have unmarked overload support" +#endif + +void to_foo0(int); +void to_foo0(double) __attribute__((overloadable)); // expected-note{{previous overload}} +void to_foo0(int); +void to_foo0(double); // expected-error{{must have the 'overloadable' attribute}} +void to_foo0(int); + +void to_foo1(int) __attribute__((overloadable)); // expected-note 2{{previous overload}} +void to_foo1(double); +void to_foo1(int); // expected-error{{must have the 'overloadable' attribute}} +void to_foo1(double); +void to_foo1(int); // expected-error{{must have the 'overloadable' attribute}} + +void to_foo2(int); // expected-note{{previous unmarked overload}} +void to_foo2(double) __attribute__((overloadable)); // expected-note 2{{previous overload}} +void to_foo2(int) __attribute__((overloadable)); // expected-error {{must not have the 'overloadable' attribute}} +void to_foo2(double); // expected-error{{must have the 'overloadable' attribute}} +void to_foo2(int); +void to_foo2(double); // expected-error{{must have the 'overloadable' attribute}} +void to_foo2(int); + +void to_foo3(int); +void to_foo3(double) __attribute__((overloadable)); // expected-note{{previous overload}} +void to_foo3(int); +void to_foo3(double); // expected-error{{must have the 'overloadable' attribute}} + +void to_foo4(int) __attribute__((overloadable)); // expected-note{{previous overload}} +void to_foo4(int); // expected-error{{must have the 'overloadable' attribute}} +void to_foo4(double) __attribute__((overloadable)); + +void to_foo5(int); +void to_foo5(int); // expected-note 3{{previous unmarked overload}} +void to_foo5(float) __attribute__((overloadable)); +void to_foo5(double); // expected-error{{at most one overload for a given name may lack the 'overloadable' attribute}} +void to_foo5(float) __attribute__((overloadable)); +void to_foo5(short); // expected-error{{at most one overload for a given name may lack the 'overloadable' attribute}} +void to_foo5(long); // expected-error{{at most one overload for a given name may lack the 'overloadable' attribute}} +void to_foo5(double) __attribute__((overloadable)); + +void to_foo6(int) __attribute__((enable_if(1, ""), overloadable)); // expected-note{{previous overload}} +void to_foo6(int) __attribute__((enable_if(1, ""))); // expected-error{{must have the 'overloadable' attribute}} +void to_foo6(int) __attribute__((enable_if(1, ""), overloadable)); + +void to_foo7(int) __attribute__((enable_if(1, ""))); // expected-note{{previous unmarked overload}} +void to_foo7(int) __attribute__((enable_if(1, ""), overloadable)); // expected-error{{must not have the 'overloadable' attribute}} +void to_foo7(int) __attribute__((enable_if(1, ""))); + +void to_foo8(char *__attribute__((pass_object_size(0)))) + __attribute__((enable_if(1, ""))); +void to_foo8(char *__attribute__((pass_object_size(0)))) + __attribute__((overloadable)); + +void to_foo9(int); // expected-note{{previous unmarked overload}} +// FIXME: It would be nice if we did better with the "previous unmarked +// overload" diag. +void to_foo9(int) __attribute__((overloadable)); // expected-error{{must not have the 'overloadable' attribute}} expected-note{{previous declaration}} expected-note{{previous unmarked overload}} +void to_foo9(float); // expected-error{{conflicting types for 'to_foo9'}} +void to_foo9(float) __attribute__((overloadable)); +void to_foo9(double); // expected-error{{at most one overload for a given name may lack the 'overloadable' attribute}} +void to_foo9(double) __attribute__((overloadable)); + +void to_foo10(int) __attribute__((overloadable)); +void to_foo10(double); // expected-note{{previous unmarked overload}} +// no "note: previous redecl" if no previous decl has `overloadable` +// spelled out +void to_foo10(float); // expected-error{{at most one overload for a given name may lack the 'overloadable' attribute}} +void to_foo10(float); // expected-error{{must have the 'overloadable' attribute}} +void to_foo10(float); // expected-error{{must have the 'overloadable' attribute}} + // Bug: we used to treat `__typeof__(foo)` as though it was `__typeof__(&foo)` // if `foo` was overloaded with only one function that could have its address // taken. diff --git a/test/SemaCXX/constant-expression-cxx11.cpp b/test/SemaCXX/constant-expression-cxx11.cpp index 4abbc8e92847..3fda2d0a7fd0 100644 --- a/test/SemaCXX/constant-expression-cxx11.cpp +++ b/test/SemaCXX/constant-expression-cxx11.cpp @@ -608,7 +608,7 @@ namespace DependentValues { struct I { int n; typedef I V[10]; }; I::V x, y; -int g(); +int g(); // expected-note {{declared here}} template<bool B, typename T> struct S : T { int k; void f() { @@ -616,13 +616,23 @@ template<bool B, typename T> struct S : T { I &i = cells[k]; switch (i.n) {} - // FIXME: We should be able to diagnose this. - constexpr int n = g(); + constexpr int n = g(); // expected-error {{must be initialized by a constant expression}} expected-note {{non-constexpr function 'g'}} constexpr int m = this->g(); // ok, could be constexpr } }; +extern const int n; +template<typename T> void f() { + // This is ill-formed, because a hypothetical instantiation at the point of + // template definition would be ill-formed due to a construct that does not + // depend on a template parameter. + constexpr int k = n; // expected-error {{must be initialized by a constant expression}} +} +// It doesn't matter that the instantiation could later become valid: +constexpr int n = 4; +template void f<int>(); + } namespace Class { diff --git a/test/SemaCXX/eval-crashes.cpp b/test/SemaCXX/eval-crashes.cpp new file mode 100644 index 000000000000..23946845d8ed --- /dev/null +++ b/test/SemaCXX/eval-crashes.cpp @@ -0,0 +1,56 @@ +// RUN: %clang_cc1 -std=c++1z -verify %s + +namespace pr32864_0 { + struct transfer_t { + void *fctx; + }; + template <typename Ctx> class record { + void run() { + transfer_t t; + Ctx from{t.fctx}; + } + }; +} + +namespace pr33140_0a { + struct S { + constexpr S(const int &a = 0) {} + }; + void foo(void) { S s[2] = {}; } +} + +namespace pr33140_0b { + bool bar(float const &f = 0); + bool foo() { return bar() && bar(); } +} + +namespace pr33140_2 { + // FIXME: The declaration of 'b' below should lifetime-extend two int + // temporaries, invalidating this warning to some extent. + struct A { int &&r = 0; }; // expected-warning {{binding reference member 'r' to a temporary}} expected-note {{here}} + struct B { A x, y; }; + B b = {}; +} + +namespace pr33140_3 { + typedef struct Y { unsigned int c; } Y_t; + struct X { + Y_t a; + }; + struct X foo[2] = {[0 ... 1] = {.a = (Y_t){.c = 0}}}; +} + +namespace pr33140_6 { + struct Y { unsigned int c; }; + struct X { struct Y *p; }; + int f() { + // FIXME: This causes clang to crash. + //return (struct X[2]){ [0 ... 1] = { .p = &(struct Y&)(struct Y&&)(struct Y){0} } }[0].p->c; + return 0; + } +} + +namespace pr33140_10 { + int a(const int &n = 0); + bool b() { return a() == a(); } +} diff --git a/test/SemaCXX/type-traits.cpp b/test/SemaCXX/type-traits.cpp index 8a994f01ba1a..5879a77dd5a8 100644 --- a/test/SemaCXX/type-traits.cpp +++ b/test/SemaCXX/type-traits.cpp @@ -1447,7 +1447,9 @@ void has_trivial_default_constructor() { { int arr[T(__has_trivial_constructor(const Int))]; } { int arr[T(__has_trivial_constructor(AllDefaulted))]; } { int arr[T(__has_trivial_constructor(AllDeleted))]; } + { int arr[T(__has_trivial_constructor(ACompleteType[]))]; } + { int arr[F(__has_trivial_constructor(AnIncompleteType[]))]; } // expected-error {{incomplete type}} { int arr[F(__has_trivial_constructor(HasCons))]; } { int arr[F(__has_trivial_constructor(HasRef))]; } { int arr[F(__has_trivial_constructor(HasCopy))]; } @@ -1478,7 +1480,9 @@ void has_trivial_move_constructor() { { int arr[T(__has_trivial_move_constructor(HasCons))]; } { int arr[T(__has_trivial_move_constructor(HasStaticMemberMoveCtor))]; } { int arr[T(__has_trivial_move_constructor(AllDeleted))]; } - + { int arr[T(__has_trivial_move_constructor(ACompleteType[]))]; } + + { int arr[F(__has_trivial_move_constructor(AnIncompleteType[]))]; } // expected-error {{incomplete type}} { int arr[F(__has_trivial_move_constructor(HasVirt))]; } { int arr[F(__has_trivial_move_constructor(DerivesVirt))]; } { int arr[F(__has_trivial_move_constructor(HasMoveCtor))]; } @@ -1508,7 +1512,9 @@ void has_trivial_copy_constructor() { { int arr[T(__has_trivial_copy(AllDeleted))]; } { int arr[T(__has_trivial_copy(DerivesAr))]; } { int arr[T(__has_trivial_copy(DerivesHasRef))]; } + { int arr[T(__has_trivial_copy(ACompleteType[]))]; } + { int arr[F(__has_trivial_copy(AnIncompleteType[]))]; } // expected-error {{incomplete type}} { int arr[F(__has_trivial_copy(HasCopy))]; } { int arr[F(__has_trivial_copy(HasTemplateCons))]; } { int arr[F(__has_trivial_copy(VirtAr))]; } @@ -1536,7 +1542,9 @@ void has_trivial_copy_assignment() { { int arr[T(__has_trivial_assign(AllDeleted))]; } { int arr[T(__has_trivial_assign(DerivesAr))]; } { int arr[T(__has_trivial_assign(DerivesHasRef))]; } + { int arr[T(__has_trivial_assign(ACompleteType[]))]; } + { int arr[F(__has_trivial_assign(AnIncompleteType[]))]; } // expected-error {{incomplete type}} { int arr[F(__has_trivial_assign(IntRef))]; } { int arr[F(__has_trivial_assign(HasCopyAssign))]; } { int arr[F(__has_trivial_assign(const Int))]; } @@ -1572,8 +1580,10 @@ void has_trivial_destructor() { { int arr[T(__has_trivial_destructor(AllDefaulted))]; } { int arr[T(__has_trivial_destructor(AllDeleted))]; } { int arr[T(__has_trivial_destructor(DerivesHasRef))]; } + { int arr[T(__has_trivial_destructor(ACompleteType[]))]; } { int arr[F(__has_trivial_destructor(HasDest))]; } + { int arr[F(__has_trivial_destructor(AnIncompleteType[]))]; } // expected-error {{incomplete type}} { int arr[F(__has_trivial_destructor(void))]; } { int arr[F(__has_trivial_destructor(cvoid))]; } { int arr[F(__has_trivial_destructor(AllPrivate))]; } @@ -1625,7 +1635,9 @@ void has_nothrow_assign() { { int arr[T(__has_nothrow_assign(AllPrivate))]; } { int arr[T(__has_nothrow_assign(UsingAssign))]; } { int arr[T(__has_nothrow_assign(DerivesAr))]; } + { int arr[T(__has_nothrow_assign(ACompleteType[]))]; } + { int arr[F(__has_nothrow_assign(AnIncompleteType[]))]; } // expected-error {{incomplete type}} { int arr[F(__has_nothrow_assign(IntRef))]; } { int arr[F(__has_nothrow_assign(HasCopyAssign))]; } { int arr[F(__has_nothrow_assign(HasMultipleCopyAssign))]; } @@ -1650,8 +1662,9 @@ void has_nothrow_move_assign() { { int arr[T(__has_nothrow_move_assign(HasMemberNoThrowMoveAssign))]; } { int arr[T(__has_nothrow_move_assign(HasMemberNoExceptNoThrowMoveAssign))]; } { int arr[T(__has_nothrow_move_assign(AllDeleted))]; } + { int arr[T(__has_nothrow_move_assign(ACompleteType[]))]; } - + { int arr[F(__has_nothrow_move_assign(AnIncompleteType[]))]; } // expected-error {{incomplete type}} { int arr[F(__has_nothrow_move_assign(HasThrowMoveAssign))]; } { int arr[F(__has_nothrow_move_assign(HasNoExceptFalseMoveAssign))]; } { int arr[F(__has_nothrow_move_assign(HasMemberThrowMoveAssign))]; } @@ -1683,7 +1696,9 @@ void has_trivial_move_assign() { { int arr[T(__has_trivial_move_assign(Int))]; } { int arr[T(__has_trivial_move_assign(HasStaticMemberMoveAssign))]; } { int arr[T(__has_trivial_move_assign(AllDeleted))]; } + { int arr[T(__has_trivial_move_assign(ACompleteType[]))]; } + { int arr[F(__has_trivial_move_assign(AnIncompleteType[]))]; } // expected-error {{incomplete type}} { int arr[F(__has_trivial_move_assign(HasVirt))]; } { int arr[F(__has_trivial_move_assign(DerivesVirt))]; } { int arr[F(__has_trivial_move_assign(HasMoveAssign))]; } @@ -1717,7 +1732,9 @@ void has_nothrow_copy() { { int arr[T(__has_nothrow_copy(HasTemplateCons))]; } { int arr[T(__has_nothrow_copy(AllPrivate))]; } { int arr[T(__has_nothrow_copy(DerivesAr))]; } + { int arr[T(__has_nothrow_copy(ACompleteType[]))]; } + { int arr[F(__has_nothrow_copy(AnIncompleteType[]))]; } // expected-error {{incomplete type}} { int arr[F(__has_nothrow_copy(HasCopy))]; } { int arr[F(__has_nothrow_copy(HasMultipleCopy))]; } { int arr[F(__has_nothrow_copy(VirtAr))]; } @@ -1743,7 +1760,9 @@ void has_nothrow_constructor() { { int arr[T(__has_nothrow_constructor(HasVirtDest))]; } // { int arr[T(__has_nothrow_constructor(VirtAr))]; } // not implemented { int arr[T(__has_nothrow_constructor(AllPrivate))]; } + { int arr[T(__has_nothrow_constructor(ACompleteType[]))]; } + { int arr[F(__has_nothrow_constructor(AnIncompleteType[]))]; } // expected-error {{incomplete type}} { int arr[F(__has_nothrow_constructor(HasCons))]; } { int arr[F(__has_nothrow_constructor(HasRef))]; } { int arr[F(__has_nothrow_constructor(HasCopy))]; } @@ -1779,7 +1798,9 @@ void has_virtual_destructor() { { int arr[F(__has_virtual_destructor(HasMoveAssign))]; } { int arr[F(__has_virtual_destructor(IntRef))]; } { int arr[F(__has_virtual_destructor(VirtAr))]; } + { int arr[F(__has_virtual_destructor(ACompleteType[]))]; } + { int arr[F(__has_virtual_destructor(AnIncompleteType[]))]; } // expected-error {{incomplete type}} { int arr[T(__has_virtual_destructor(HasVirtDest))]; } { int arr[T(__has_virtual_destructor(DerivedVirtDest))]; } { int arr[F(__has_virtual_destructor(VirtDestAr))]; } diff --git a/test/SemaCXX/unavailable_aligned_allocation.cpp b/test/SemaCXX/unavailable_aligned_allocation.cpp new file mode 100644 index 000000000000..2ae5d2e2c704 --- /dev/null +++ b/test/SemaCXX/unavailable_aligned_allocation.cpp @@ -0,0 +1,109 @@ +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -faligned-alloc-unavailable -std=c++1z -verify %s +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -std=c++1z -verify -DNO_ERRORS %s +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -faligned-allocation -faligned-alloc-unavailable -std=c++14 -verify %s + +namespace std { + typedef decltype(sizeof(0)) size_t; + enum class align_val_t : std::size_t {}; + struct nothrow_t {}; + nothrow_t nothrow; +} + +void *operator new(std::size_t __sz, const std::nothrow_t&) noexcept; +void *operator new[](std::size_t __sz, const std::nothrow_t&) noexcept; + +void *operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) noexcept; +void *operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) noexcept; +void operator delete(void *, std::align_val_t, const std::nothrow_t&); +void operator delete[](void *, std::align_val_t, const std::nothrow_t&); +void operator delete(void*, std::size_t, std::align_val_t) noexcept; +void operator delete[](void*, std::size_t, std::align_val_t) noexcept; + +void *operator new(std::size_t, std::align_val_t, long long); + +struct alignas(256) OveralignedS { + int x[16]; +}; + +struct S { + int x[16]; +}; + +void test() { + auto *p = new S; + delete p; + p = new (std::nothrow) S; + + auto *pa = new S[4]; + delete[] pa; + pa = new (std::nothrow) S[4]; +} + +void testOveraligned() { + auto *p = new OveralignedS; + p = new ((std::align_val_t)8) OveralignedS; + delete p; + p = new (std::nothrow) OveralignedS; + + auto *pa = new OveralignedS[4]; + pa = new ((std::align_val_t)8) OveralignedS[4]; + delete[] pa; + pa = new (std::nothrow) OveralignedS[4]; + // No error here since it is not calling a replaceable allocation function. + p = new ((std::align_val_t)8, 10LL) OveralignedS; +} + +#ifdef NO_ERRORS +// expected-no-diagnostics +#else +// expected-error@-16 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' possibly unavailable on}} +// expected-note@-17 {{if you supply your own aligned allocation functions}} +// expected-error@-18 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' possibly unavailable on}} +// expected-note@-19 {{if you supply your own aligned allocation functions}} + +// expected-error@-20 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' possibly unavailable on}} +// expected-note@-21 {{if you supply your own aligned allocation functions}} +// expected-error@-22 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' possibly unavailable on}} +// expected-note@-23 {{if you supply your own aligned allocation functions}} + +// expected-error@-24 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' possibly unavailable on}} +// expected-note@-25 {{if you supply your own aligned allocation functions}} + +// expected-error@-26 {{aligned allocation function of type 'void *(std::size_t, std::align_val_t, const std::nothrow_t &) noexcept' possibly unavailable on}} +// expected-note@-27 {{if you supply your own aligned allocation functions}} +// expected-error@-28 {{aligned deallocation function of type 'void (void *, std::align_val_t, const std::nothrow_t &) noexcept' possibly unavailable on}} +// expected-note@-29 {{if you supply your own aligned allocation functions}} + +// expected-error@-29 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' possibly unavailable on}} +// expected-note@-30 {{if you supply your own aligned allocation functions}} +// expected-error@-31 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' possibly unavailable on}} +// expected-note@-32 {{if you supply your own aligned allocation functions}} + +// expected-error@-33 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' possibly unavailable on}} +// expected-note@-34 {{if you supply your own aligned allocation functions}} +// expected-error@-35 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' possibly unavailable on}} +// expected-note@-36 {{if you supply your own aligned allocation functions}} + +// expected-error@-37 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' possibly unavailable on}} +// expected-note@-38 {{if you supply your own aligned allocation functions}} + +// expected-error@-39 {{aligned allocation function of type 'void *(std::size_t, std::align_val_t, const std::nothrow_t &) noexcept' possibly unavailable on}} +// expected-note@-40 {{if you supply your own aligned allocation functions}} +// expected-error@-41 {{aligned deallocation function of type 'void (void *, std::align_val_t, const std::nothrow_t &) noexcept' possibly unavailable on}} +// expected-note@-42 {{if you supply your own aligned allocation functions}} + +#endif + +// No errors if user-defined aligned allocation functions are available. +void *operator new(std::size_t __sz, std::align_val_t) { + static char array[256]; + return &array; +} + +void operator delete(void *p, std::align_val_t) { +} + +void testOveraligned2() { + auto p = new ((std::align_val_t)8) OveralignedS; + delete p; +} diff --git a/test/SemaCXX/warn-throw-out-noexcept-func.cpp b/test/SemaCXX/warn-throw-out-noexcept-func.cpp index dfd1ff9065ab..fc2919a1e327 100644 --- a/test/SemaCXX/warn-throw-out-noexcept-func.cpp +++ b/test/SemaCXX/warn-throw-out-noexcept-func.cpp @@ -253,6 +253,43 @@ void with_try_block1() noexcept try { //expected-note {{non-throwing function de } catch (char *) { } +namespace derived { +struct B {}; +struct D: B {}; +void goodPlain() noexcept { + try { + throw D(); + } catch (B) {} +} +void goodReference() noexcept { + try { + throw D(); + } catch (B &) {} +} +void goodPointer() noexcept { + D d; + try { + throw &d; + } catch (B *) {} +} +void badPlain() noexcept { // expected-note {{non-throwing function declare here}} + try { + throw B(); // expected-warning {{'badPlain' has a non-throwing exception specification but can still throw, resulting in unexpected program termination}} + } catch (D) {} +} +void badReference() noexcept { // expected-note {{non-throwing function declare here}} + try { + throw B(); // expected-warning {{'badReference' has a non-throwing exception specification but can still throw, resulting in unexpected program termination}} + } catch (D &) {} +} +void badPointer() noexcept { // expected-note {{non-throwing function declare here}} + B b; + try { + throw &b; // expected-warning {{'badPointer' has a non-throwing exception specification but can still throw, resulting in unexpected program termination}} + } catch (D *) {} +} +} + int main() { R1_ShouldDiag<int> o; //expected-note {{in instantiation of member function}} S1_ShouldDiag<int> b; //expected-note {{in instantiation of member function}} diff --git a/test/SemaOpenCL/extension-begin.cl b/test/SemaOpenCL/extension-begin.cl index 3393458a893a..92ea88143233 100644 --- a/test/SemaOpenCL/extension-begin.cl +++ b/test/SemaOpenCL/extension-begin.cl @@ -46,7 +46,7 @@ void test_f2(void) { const struct A test_A_local; // expected-error {{use of type 'struct A' requires my_ext extension to be enabled}} TypedefOfA test_typedef_A; // expected-error {{use of type 'TypedefOfA' (aka 'struct A') requires my_ext extension to be enabled}} PointerOfA test_A_pointer; // expected-error {{use of type 'PointerOfA' (aka 'const struct A *') requires my_ext extension to be enabled}} - f(); // expected-error {{use of declaration requires my_ext extension to be enabled}} + f(); // expected-error {{use of declaration 'f' requires my_ext extension to be enabled}} g(0); // expected-error {{no matching function for call to 'g'}} // expected-note@-26 {{candidate disabled due to OpenCL extension}} // expected-note@-22 {{candidate function not viable: requires 0 arguments, but 1 was provided}} diff --git a/test/SemaTemplate/destructor-template.cpp b/test/SemaTemplate/destructor-template.cpp index 853ba492f8e7..6570b6456406 100644 --- a/test/SemaTemplate/destructor-template.cpp +++ b/test/SemaTemplate/destructor-template.cpp @@ -86,3 +86,9 @@ namespace PR16852 { template<typename T> decltype(S<T>().~S()) f(); // expected-note {{candidate template ignored: couldn't infer template argument 'T'}} void g() { f(); } // expected-error {{no matching function for call to 'f'}} } + +class PR33189 +{ + template <class T> + ~PR33189() { } // expected-error{{destructor cannot be declared as a template}} +}; diff --git a/test/clang-rename/ClassAsTemplateArgument.cpp b/test/clang-rename/ClassAsTemplateArgument.cpp new file mode 100644 index 000000000000..2e09a5b529e7 --- /dev/null +++ b/test/clang-rename/ClassAsTemplateArgument.cpp @@ -0,0 +1,21 @@ +class Foo /* Test 1 */ {}; // CHECK: class Bar /* Test 1 */ {}; + +template <typename T> +void func() {} + +template <typename T> +class Baz {}; + +int main() { + func<Foo>(); // CHECK: func<Bar>(); + Baz<Foo> /* Test 2 */ obj; // CHECK: Baz<Bar> /* Test 2 */ obj; + return 0; +} + +// Test 1. +// RUN: clang-rename -offset=7 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 2. +// RUN: clang-rename -offset=215 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'Foo.*' <file> diff --git a/test/clang-rename/ClassFindByName.cpp b/test/clang-rename/ClassFindByName.cpp new file mode 100644 index 000000000000..4430891ec4b1 --- /dev/null +++ b/test/clang-rename/ClassFindByName.cpp @@ -0,0 +1,10 @@ +class Foo { // CHECK: class Bar { +}; + +int main() { + Foo *Pointer = 0; // CHECK: Bar *Pointer = 0; + return 0; +} + +// Test 1. +// RUN: clang-rename -qualified-name=Foo -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s diff --git a/test/clang-rename/ClassSimpleRenaming.cpp b/test/clang-rename/ClassSimpleRenaming.cpp new file mode 100644 index 000000000000..086f55736cb7 --- /dev/null +++ b/test/clang-rename/ClassSimpleRenaming.cpp @@ -0,0 +1,14 @@ +class Foo /* Test 1 */ { // CHECK: class Bar /* Test 1 */ { +public: + void foo(int x); +}; + +void Foo::foo(int x) /* Test 2 */ {} // CHECK: void Bar::foo(int x) /* Test 2 */ {} + +// Test 1. +// RUN: clang-rename -offset=6 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 2. +// RUN: clang-rename -offset=109 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'Foo.*' <file> diff --git a/test/clang-rename/ClassTestMulti.cpp b/test/clang-rename/ClassTestMulti.cpp new file mode 100644 index 000000000000..81e65c760652 --- /dev/null +++ b/test/clang-rename/ClassTestMulti.cpp @@ -0,0 +1,11 @@ +class Foo1 /* Offset 1 */ { // CHECK: class Bar1 /* Offset 1 */ { +}; + +class Foo2 /* Offset 2 */ { // CHECK: class Bar2 /* Offset 2 */ { +}; + +// Test 1. +// RUN: clang-rename -offset=6 -new-name=Bar1 -offset=76 -new-name=Bar2 %s -- | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'Foo.*' <file> diff --git a/test/clang-rename/ClassTestMultiByName.cpp b/test/clang-rename/ClassTestMultiByName.cpp new file mode 100644 index 000000000000..61b69a1bdf4c --- /dev/null +++ b/test/clang-rename/ClassTestMultiByName.cpp @@ -0,0 +1,8 @@ +class Foo1 { // CHECK: class Bar1 +}; + +class Foo2 { // CHECK: class Bar2 +}; + +// Test 1. +// RUN: clang-rename -qualified-name=Foo1 -new-name=Bar1 -qualified-name=Foo2 -new-name=Bar2 %s -- | sed 's,//.*,,' | FileCheck %s diff --git a/test/clang-rename/ComplexFunctionOverride.cpp b/test/clang-rename/ComplexFunctionOverride.cpp new file mode 100644 index 000000000000..ccf3a20e5400 --- /dev/null +++ b/test/clang-rename/ComplexFunctionOverride.cpp @@ -0,0 +1,47 @@ +struct A { + virtual void foo() {} /* Test 1 */ // CHECK: virtual void bar() {} +}; + +struct B : A { + void foo() override {} /* Test 2 */ // CHECK: void bar() override {} +}; + +struct C : B { + void foo() override {} /* Test 3 */ // CHECK: void bar() override {} +}; + +struct D : B { + void foo() override {} /* Test 4 */ // CHECK: void bar() override {} +}; + +struct E : D { + void foo() override {} /* Test 5 */ // CHECK: void bar() override {} +}; + +int main() { + A a; + a.foo(); // CHECK: a.bar(); + B b; + b.foo(); // CHECK: b.bar(); + C c; + c.foo(); // CHECK: c.bar(); + D d; + d.foo(); // CHECK: d.bar(); + E e; + e.foo(); // CHECK: e.bar(); + return 0; +} + +// Test 1. +// RUN: clang-rename -offset=26 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 2. +// RUN: clang-rename -offset=109 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 3. +// RUN: clang-rename -offset=201 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 4. +// RUN: clang-rename -offset=293 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 5. +// RUN: clang-rename -offset=385 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'foo.*' <file> diff --git a/test/clang-rename/ComplicatedClassType.cpp b/test/clang-rename/ComplicatedClassType.cpp new file mode 100644 index 000000000000..880195303127 --- /dev/null +++ b/test/clang-rename/ComplicatedClassType.cpp @@ -0,0 +1,63 @@ +// Forward declaration. +class Foo; /* Test 1 */ // CHECK: class Bar; /* Test 1 */ + +class Baz { + virtual int getValue() const = 0; +}; + +class Foo : public Baz { /* Test 2 */// CHECK: class Bar : public Baz { +public: + Foo(int value = 0) : x(value) {} // CHECK: Bar(int value = 0) : x(value) {} + + Foo &operator++(int) { // CHECK: Bar &operator++(int) { + x++; + return *this; + } + + bool operator<(Foo const &rhs) { // CHECK: bool operator<(Bar const &rhs) { + return this->x < rhs.x; + } + + int getValue() const { + return 0; + } + +private: + int x; +}; + +int main() { + Foo *Pointer = 0; // CHECK: Bar *Pointer = 0; + Foo Variable = Foo(10); // CHECK: Bar Variable = Bar(10); + for (Foo it; it < Variable; it++) { // CHECK: for (Bar it; it < Variable; it++) { + } + const Foo *C = new Foo(); // CHECK: const Bar *C = new Bar(); + const_cast<Foo *>(C)->getValue(); // CHECK: const_cast<Bar *>(C)->getValue(); + Foo foo; // CHECK: Bar foo; + const Baz &BazReference = foo; + const Baz *BazPointer = &foo; + dynamic_cast<const Foo &>(BazReference).getValue(); /* Test 3 */ // CHECK: dynamic_cast<const Bar &>(BazReference).getValue(); + dynamic_cast<const Foo *>(BazPointer)->getValue(); /* Test 4 */ // CHECK: dynamic_cast<const Bar *>(BazPointer)->getValue(); + reinterpret_cast<const Foo *>(BazPointer)->getValue(); /* Test 5 */ // CHECK: reinterpret_cast<const Bar *>(BazPointer)->getValue(); + static_cast<const Foo &>(BazReference).getValue(); /* Test 6 */ // CHECK: static_cast<const Bar &>(BazReference).getValue(); + static_cast<const Foo *>(BazPointer)->getValue(); /* Test 7 */ // CHECK: static_cast<const Bar *>(BazPointer)->getValue(); + return 0; +} + +// Test 1. +// RUN: clang-rename -offset=30 -new-name=Bar %s -- -frtti | sed 's,//.*,,' | FileCheck %s +// Test 2. +// RUN: clang-rename -offset=155 -new-name=Bar %s -- -frtti | sed 's,//.*,,' | FileCheck %s +// Test 3. +// RUN: clang-rename -offset=1133 -new-name=Bar %s -- -frtti | sed 's,//.*,,' | FileCheck %s +// Test 4. +// RUN: clang-rename -offset=1266 -new-name=Bar %s -- -frtti | sed 's,//.*,,' | FileCheck %s +// Test 5. +// RUN: clang-rename -offset=1402 -new-name=Bar %s -- -frtti | sed 's,//.*,,' | FileCheck %s +// Test 6. +// RUN: clang-rename -offset=1533 -new-name=Bar %s -- -frtti | sed 's,//.*,,' | FileCheck %s +// Test 7. +// RUN: clang-rename -offset=1665 -new-name=Bar %s -- -frtti | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'Foo.*' <file> diff --git a/test/clang-rename/Ctor.cpp b/test/clang-rename/Ctor.cpp new file mode 100644 index 000000000000..9908a4123ddf --- /dev/null +++ b/test/clang-rename/Ctor.cpp @@ -0,0 +1,14 @@ +class Foo { // CHECK: class Bar { +public: + Foo(); /* Test 1 */ // CHECK: Bar(); +}; + +Foo::Foo() /* Test 2 */ {} // CHECK: Bar::Bar() /* Test 2 */ {} + +// Test 1. +// RUN: clang-rename -offset=62 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 2. +// RUN: clang-rename -offset=116 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'Foo.*' <file> diff --git a/test/clang-rename/CtorInitializer.cpp b/test/clang-rename/CtorInitializer.cpp new file mode 100644 index 000000000000..fed4f5b06c27 --- /dev/null +++ b/test/clang-rename/CtorInitializer.cpp @@ -0,0 +1,17 @@ +class Baz {}; + +class Qux { + Baz Foo; /* Test 1 */ // CHECK: Baz Bar; +public: + Qux(); +}; + +Qux::Qux() : Foo() /* Test 2 */ {} // CHECK: Qux::Qux() : Bar() /* Test 2 */ {} + +// Test 1. +// RUN: clang-rename -offset=33 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 2. +// RUN: clang-rename -offset=118 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'Foo.*' <file> diff --git a/test/clang-rename/DeclRefExpr.cpp b/test/clang-rename/DeclRefExpr.cpp new file mode 100644 index 000000000000..6462862d82ad --- /dev/null +++ b/test/clang-rename/DeclRefExpr.cpp @@ -0,0 +1,24 @@ +class C { +public: + static int Foo; /* Test 1 */ // CHECK: static int Bar; +}; + +int foo(int x) { return 0; } +#define MACRO(a) foo(a) + +int main() { + C::Foo = 1; /* Test 2 */ // CHECK: C::Bar = 1; + MACRO(C::Foo); // CHECK: MACRO(C::Bar); + int y = C::Foo; /* Test 3 */ // CHECK: int y = C::Bar; + return 0; +} + +// Test 1. +// RUN: clang-rename -offset=31 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 2. +// RUN: clang-rename -offset=152 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 3. +// RUN: clang-rename -offset=271 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'Foo.*' <file> diff --git a/test/clang-rename/Field.cpp b/test/clang-rename/Field.cpp new file mode 100644 index 000000000000..c0e9a019e47e --- /dev/null +++ b/test/clang-rename/Field.cpp @@ -0,0 +1,15 @@ +class Baz { + int Foo; /* Test 1 */ // CHECK: int Bar; +public: + Baz(); +}; + +Baz::Baz() : Foo(0) /* Test 2 */ {} // CHECK: Baz::Baz() : Bar(0) + +// Test 1. +// RUN: clang-rename -offset=18 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 2. +// RUN: clang-rename -offset=89 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'Foo.*' <file> diff --git a/test/clang-rename/FunctionMacro.cpp b/test/clang-rename/FunctionMacro.cpp new file mode 100644 index 000000000000..6e87026ec706 --- /dev/null +++ b/test/clang-rename/FunctionMacro.cpp @@ -0,0 +1,20 @@ +#define moo foo // CHECK: #define moo macro_function + +int foo() /* Test 1 */ { // CHECK: int macro_function() /* Test 1 */ { + return 42; +} + +void boo(int value) {} + +void qoo() { + foo(); // CHECK: macro_function(); + boo(foo()); // CHECK: boo(macro_function()); + moo(); + boo(moo()); +} + +// Test 1. +// RUN: clang-rename -offset=68 -new-name=macro_function %s -- | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'foo.*' <file> diff --git a/test/clang-rename/FunctionOverride.cpp b/test/clang-rename/FunctionOverride.cpp new file mode 100644 index 000000000000..adfeb739e66d --- /dev/null +++ b/test/clang-rename/FunctionOverride.cpp @@ -0,0 +1,13 @@ +class A { virtual void foo(); /* Test 1 */ }; // CHECK: class A { virtual void bar(); +class B : public A { void foo(); /* Test 2 */ }; // CHECK: class B : public A { void bar(); +class C : public B { void foo(); /* Test 3 */ }; // CHECK: class C : public B { void bar(); + +// Test 1. +// RUN: clang-rename -offset=23 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 2. +// RUN: clang-rename -offset=116 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 3. +// RUN: clang-rename -offset=209 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'foo.*' <file> diff --git a/test/clang-rename/FunctionWithClassFindByName.cpp b/test/clang-rename/FunctionWithClassFindByName.cpp new file mode 100644 index 000000000000..2cae09a1c244 --- /dev/null +++ b/test/clang-rename/FunctionWithClassFindByName.cpp @@ -0,0 +1,12 @@ +void foo() { +} + +class Foo { // CHECK: class Bar +}; + +int main() { + Foo *Pointer = 0; // CHECK: Bar *Pointer = 0; + return 0; +} + +// RUN: clang-rename -qualified-name=Foo -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s diff --git a/test/clang-rename/IncludeHeaderWithSymbol.cpp b/test/clang-rename/IncludeHeaderWithSymbol.cpp new file mode 100644 index 000000000000..cb2baee57b89 --- /dev/null +++ b/test/clang-rename/IncludeHeaderWithSymbol.cpp @@ -0,0 +1,10 @@ +#include "Inputs/HeaderWithSymbol.h" + +int main() { + return 0; // CHECK: {{^ return 0;}} +} + +// Test 1. +// The file IncludeHeaderWithSymbol.cpp doesn't contain the symbol Foo +// and is expected to be written to stdout without modifications +// RUN: clang-rename -qualified-name=Foo -new-name=Bar %s -- | FileCheck %s diff --git a/test/clang-rename/Inputs/HeaderWithSymbol.h b/test/clang-rename/Inputs/HeaderWithSymbol.h new file mode 100644 index 000000000000..1fe02e89786c --- /dev/null +++ b/test/clang-rename/Inputs/HeaderWithSymbol.h @@ -0,0 +1 @@ +struct Foo {}; diff --git a/test/clang-rename/Inputs/OffsetToNewName.yaml b/test/clang-rename/Inputs/OffsetToNewName.yaml new file mode 100644 index 000000000000..d8e972880f36 --- /dev/null +++ b/test/clang-rename/Inputs/OffsetToNewName.yaml @@ -0,0 +1,6 @@ +--- +- Offset: 6 + NewName: Bar1 +- Offset: 44 + NewName: Bar2 +... diff --git a/test/clang-rename/Inputs/QualifiedNameToNewName.yaml b/test/clang-rename/Inputs/QualifiedNameToNewName.yaml new file mode 100644 index 000000000000..6e3783671dfa --- /dev/null +++ b/test/clang-rename/Inputs/QualifiedNameToNewName.yaml @@ -0,0 +1,6 @@ +--- +- QualifiedName: Foo1 + NewName: Bar1 +- QualifiedName: Foo2 + NewName: Bar2 +... diff --git a/test/clang-rename/InvalidNewName.cpp b/test/clang-rename/InvalidNewName.cpp new file mode 100644 index 000000000000..e6b38e59420a --- /dev/null +++ b/test/clang-rename/InvalidNewName.cpp @@ -0,0 +1,2 @@ +// RUN: not clang-rename -new-name=class -offset=133 %s 2>&1 | FileCheck %s +// CHECK: ERROR: new name is not a valid identifier in C++17. diff --git a/test/clang-rename/InvalidOffset.cpp b/test/clang-rename/InvalidOffset.cpp new file mode 100644 index 000000000000..2ae04d01e4a7 --- /dev/null +++ b/test/clang-rename/InvalidOffset.cpp @@ -0,0 +1,9 @@ +#include "Inputs/HeaderWithSymbol.h" +#define FOO int bar; +FOO + +int foo; + +// RUN: not clang-rename -new-name=qux -offset=259 %s -- 2>&1 | FileCheck %s +// CHECK-NOT: CHECK +// CHECK: error: SourceLocation in file {{.*}}InvalidOffset.cpp at offset 259 is invalid diff --git a/test/clang-rename/InvalidQualifiedName.cpp b/test/clang-rename/InvalidQualifiedName.cpp new file mode 100644 index 000000000000..5280e3939ccd --- /dev/null +++ b/test/clang-rename/InvalidQualifiedName.cpp @@ -0,0 +1,4 @@ +struct S { +}; + +// RUN: clang-rename -force -qualified-name S2 -new-name=T %s -- diff --git a/test/clang-rename/MemberExprMacro.cpp b/test/clang-rename/MemberExprMacro.cpp new file mode 100644 index 000000000000..56cd8d95f6e8 --- /dev/null +++ b/test/clang-rename/MemberExprMacro.cpp @@ -0,0 +1,22 @@ +class Baz { +public: + int Foo; /* Test 1 */ // CHECK: int Bar; +}; + +int qux(int x) { return 0; } +#define MACRO(a) qux(a) + +int main() { + Baz baz; + baz.Foo = 1; /* Test 2 */ // CHECK: baz.Bar = 1; + MACRO(baz.Foo); // CHECK: MACRO(baz.Bar); + int y = baz.Foo; // CHECK: int y = baz.Bar; +} + +// Test 1. +// RUN: clang-rename -offset=26 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 2. +// RUN: clang-rename -offset=155 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'Foo.*' <file> diff --git a/test/clang-rename/Namespace.cpp b/test/clang-rename/Namespace.cpp new file mode 100644 index 000000000000..ec9630fdedb6 --- /dev/null +++ b/test/clang-rename/Namespace.cpp @@ -0,0 +1,13 @@ +namespace gcc /* Test 1 */ { // CHECK: namespace clang /* Test 1 */ { + int x; +} + +void boo() { + gcc::x = 42; // CHECK: clang::x = 42; +} + +// Test 1. +// RUN: clang-rename -offset=10 -new-name=clang %s -- | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'Foo.*' <file> diff --git a/test/clang-rename/NoNewName.cpp b/test/clang-rename/NoNewName.cpp new file mode 100644 index 000000000000..4f882d83b0c1 --- /dev/null +++ b/test/clang-rename/NoNewName.cpp @@ -0,0 +1,4 @@ +// Check for an error while -new-name argument has not been passed to +// clang-rename. +// RUN: not clang-rename -offset=133 %s 2>&1 | FileCheck %s +// CHECK: clang-rename: -new-name must be specified. diff --git a/test/clang-rename/TemplateClassInstantiation.cpp b/test/clang-rename/TemplateClassInstantiation.cpp new file mode 100644 index 000000000000..493d0951df57 --- /dev/null +++ b/test/clang-rename/TemplateClassInstantiation.cpp @@ -0,0 +1,42 @@ +template <typename T> +class Foo { /* Test 1 */ // CHECK: class Bar { /* Test 1 */ +public: + T foo(T arg, T& ref, T* ptr) { + T value; + int number = 42; + value = (T)number; + value = static_cast<T>(number); + return value; + } + static void foo(T value) {} + T member; +}; + +template <typename T> +void func() { + Foo<T> obj; /* Test 2 */ // CHECK: Bar<T> obj; + obj.member = T(); + Foo<T>::foo(); // CHECK: Bar<T>::foo(); +} + +int main() { + Foo<int> i; /* Test 3 */ // CHECK: Bar<int> i; + i.member = 0; + Foo<int>::foo(0); // CHECK: Bar<int>::foo(0); + + Foo<bool> b; // CHECK: Bar<bool> b; + b.member = false; + Foo<bool>::foo(false); // CHECK: Bar<bool>::foo(false); + + return 0; +} + +// Test 1. +// RUN: clang-rename -offset=29 -new-name=Bar %s -- -fno-delayed-template-parsing | sed 's,//.*,,' | FileCheck %s +// Test 2. +// RUN: clang-rename -offset=324 -new-name=Bar %s -- -fno-delayed-template-parsing | sed 's,//.*,,' | FileCheck %s +// Test 3. +// RUN: clang-rename -offset=463 -new-name=Bar %s -- -fno-delayed-template-parsing | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'Foo.*' <file> diff --git a/test/clang-rename/TemplateTypename.cpp b/test/clang-rename/TemplateTypename.cpp new file mode 100644 index 000000000000..559ec1f9ade7 --- /dev/null +++ b/test/clang-rename/TemplateTypename.cpp @@ -0,0 +1,24 @@ +template <typename T /* Test 1 */> // CHECK: template <typename U /* Test 1 */> +class Foo { +T foo(T arg, T& ref, T* /* Test 2 */ ptr) { // CHECK: U foo(U arg, U& ref, U* /* Test 2 */ ptr) { + T value; // CHECK: U value; + int number = 42; + value = (T)number; // CHECK: value = (U)number; + value = static_cast<T /* Test 3 */>(number); // CHECK: value = static_cast<U /* Test 3 */>(number); + return value; +} + +static void foo(T value) {} // CHECK: static void foo(U value) {} + +T member; // CHECK: U member; +}; + +// Test 1. +// RUN: clang-rename -offset=19 -new-name=U %s -- -fno-delayed-template-parsing | sed 's,//.*,,' | FileCheck %s +// Test 2. +// RUN: clang-rename -offset=126 -new-name=U %s -- -fno-delayed-template-parsing | sed 's,//.*,,' | FileCheck %s +// Test 3. +// RUN: clang-rename -offset=392 -new-name=U %s -- -fno-delayed-template-parsing | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'T.*' <file> diff --git a/test/clang-rename/TemplatedClassFunction.cpp b/test/clang-rename/TemplatedClassFunction.cpp new file mode 100644 index 000000000000..1f5b0b52ba7a --- /dev/null +++ b/test/clang-rename/TemplatedClassFunction.cpp @@ -0,0 +1,22 @@ +template <typename T> +class A { +public: + void foo() /* Test 1 */ {} // CHECK: void bar() /* Test 1 */ {} +}; + +int main(int argc, char **argv) { + A<int> a; + a.foo(); /* Test 2 */ // CHECK: a.bar() /* Test 2 */ + return 0; +} + +// Test 1. +// RUN: clang-refactor rename -offset=48 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 2. +// RUN: clang-refactor rename -offset=162 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s +// +// Currently unsupported test. +// XFAIL: * + +// To find offsets after modifying the file, use: +// grep -Ubo 'foo.*' <file> diff --git a/test/clang-rename/UserDefinedConversion.cpp b/test/clang-rename/UserDefinedConversion.cpp new file mode 100644 index 000000000000..60f251ab4483 --- /dev/null +++ b/test/clang-rename/UserDefinedConversion.cpp @@ -0,0 +1,26 @@ +class Foo { /* Test 1 */ // CHECK: class Bar { +public: + Foo() {} // CHECK: Bar() {} +}; + +class Baz { +public: + operator Foo() /* Test 2 */ const { // CHECK: operator Bar() /* Test 2 */ const { + Foo foo; // CHECK: Bar foo; + return foo; + } +}; + +int main() { + Baz boo; + Foo foo = static_cast<Foo>(boo); // CHECK: Bar foo = static_cast<Bar>(boo); + return 0; +} + +// Test 1. +// RUN: clang-rename -offset=7 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 2. +// RUN: clang-rename -offset=164 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'Foo.*' <file> diff --git a/test/clang-rename/Variable.cpp b/test/clang-rename/Variable.cpp new file mode 100644 index 000000000000..d7e670fb43ee --- /dev/null +++ b/test/clang-rename/Variable.cpp @@ -0,0 +1,33 @@ +#define NAMESPACE namespace A +NAMESPACE { +int Foo; /* Test 1 */ // CHECK: int Bar; +} +int Foo; // CHECK: int Foo; +int Qux = Foo; // CHECK: int Qux = Foo; +int Baz = A::Foo; /* Test 2 */ // CHECK: Baz = A::Bar; +void fun() { + struct { + int Foo; // CHECK: int Foo; + } b = {100}; + int Foo = 100; // CHECK: int Foo = 100; + Baz = Foo; // CHECK: Baz = Foo; + { + extern int Foo; // CHECK: extern int Foo; + Baz = Foo; // CHECK: Baz = Foo; + Foo = A::Foo /* Test 3 */ + Baz; // CHECK: Foo = A::Bar /* Test 3 */ + Baz; + A::Foo /* Test 4 */ = b.Foo; // CHECK: A::Bar /* Test 4 */ = b.Foo; + } + Foo = b.Foo; // Foo = b.Foo; +} + +// Test 1. +// RUN: clang-rename -offset=46 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 2. +// RUN: clang-rename -offset=234 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 3. +// RUN: clang-rename -offset=641 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 4. +// RUN: clang-rename -offset=716 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'Foo.*' <file> diff --git a/test/clang-rename/VariableMacro.cpp b/test/clang-rename/VariableMacro.cpp new file mode 100644 index 000000000000..622e825d3e41 --- /dev/null +++ b/test/clang-rename/VariableMacro.cpp @@ -0,0 +1,21 @@ +#define Baz Foo // CHECK: #define Baz Bar + +void foo(int value) {} + +void macro() { + int Foo; /* Test 1 */ // CHECK: int Bar; + Foo = 42; /* Test 2 */ // CHECK: Bar = 42; + Baz -= 0; + foo(Foo); /* Test 3 */ // CHECK: foo(Bar); + foo(Baz); +} + +// Test 1. +// RUN: clang-rename -offset=88 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 2. +// RUN: clang-rename -offset=129 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s +// Test 3. +// RUN: clang-rename -offset=191 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s + +// To find offsets after modifying the file, use: +// grep -Ubo 'Foo.*' <file> diff --git a/test/clang-rename/YAMLInput.cpp b/test/clang-rename/YAMLInput.cpp new file mode 100644 index 000000000000..55dbc6d66a5a --- /dev/null +++ b/test/clang-rename/YAMLInput.cpp @@ -0,0 +1,10 @@ +class Foo1 { // CHECK: class Bar1 +}; + +class Foo2 { // CHECK: class Bar2 +}; + +// Test 1. +// RUN: clang-rename -input %S/Inputs/OffsetToNewName.yaml %s -- | sed 's,//.*,,' | FileCheck %s +// Test 2. +// RUN: clang-rename -input %S/Inputs/QualifiedNameToNewName.yaml %s -- | sed 's,//.*,,' | FileCheck %s |